WorksheetsLinked list 1
Total questions: 20
Worksheet time: 10mins
The situation when in a linked list Head==NULL
is
Full
Empty
Half full
saturated
In the above image what will be printed when Head->next->data?
83
9
27
Error
What is value in the head -> next -> next below?
12
4600
1600
88
A linked list contains a list pointer variable _____that stores the address of the first node of the list.
Head
NULL
NEXT
LAST
The last node of the singly-linked list contains__________.
INFO
NULL
NEXT
None of the above
Which node’s data will be printed when
“temp =temp->next” is executed 3 times and the initial value of temp is temp=head
Null
9
27
46
how many times should
“temp =temp->next” be executed in the image to get the value of "Null" when the initial value of temp is temp=head
1
2
3
4
What is the time complexity to count the number of elements in the linked list?
O(1)
O(n)
O(log n)
none of these
Each Node contain minimum two fields one field called data field to store data. Another field is of type _________.
A
pointer to an integer
pointer to a node
pointer to a class
pointer to a character
What is the time complexity to adding an elements in front of the linked list?
O(1)
O(n)
O(log n)
none of these
What advantage does a linked list have over an array?
Size of the list doesn't need to be mentioned at the beginning of the program
You can add or remove elements from the middle of the list.
The linked list doesn't have a size limit
All of these are true.
Complete the code in the red column
string info; int link;
int info; NodeType link;
int info; string link;
int info; NodeType * link;
struct node *current = start->next
what will "current" contain if it is a pointer to a variable of type struct node ?
Address of 2nd Node
Data Field of 2nd Node
Address of 1st Node
None of these
How to delete node B?
head->next=TempPtr; free(TemPtr);
free(TemPtr); head->next=TempPtr->next;
head->next=TempPtr->next;free(TemPtr)r;
free(head); head->next= TempPtr->next
How many times should
“temp =temp->next” be executed in the image to get the value of "Null" when the initial value of temp is temp=head
1
2
3
4
The following are practical uses of linked lists (choose 1 or more)
web browsers
music player / playlist
operating system scheduler
blockchain
word processing
The situation when in a linked list START=NULL is
underflow
overflow
list full
saturated
Circular Linked List the Address part of last node holds the address of
First Node
Null
Intermediate Node
None of the Above
--------------------- is used to define a linked list in C Programming
Arrays
Structures
Functions
None
Can we add a node in between two nodes in a singly and doubly linked list?
Only in singly linked list
Only in doubly linked list
In both singly and doubly linked list
No we can't add
