NEW
Font size
WorksheetsLinked List - Implementation
Total questions: 15
Worksheet time: 39mins
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
What is the operation of the below statements?
Insert a new node to the front of a linked list
Create a new node for a linked list
Insert a new node to the end of the linked list
Calculate the size of a linked list
What is the operation of the below statements?
Create a new node for a linked list
Insert a new node to the front of a linked list
Delete a new node from a linked list
Insert a new node to the end of the linked list
Which the following circular linked list
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
Give syntax to create a node for Single linked list?
newnode=(struct node *)malloc(sizeof(struct node*));
newnode=(struct node )malloc(sizeof(struct node));
newnode=(struct node *)malloc(sizeof(struct node));
newnode=(struct node )malloc(sizeof(struct node*));
Give routine to insert at the beginning in a linked list whose structure is by struct node, with list head as L and pointer variable as next
newnode->next=next;
L=newnode;
newnode->next=node;
L=newnode;
newnode->next=L;
L=newnode;
newnode->L=next;
L=newnode;
How to insert a node after a position P in singly linked list?
Newnode -> data = P ;
Newnode -> next = p ->next ;
P -> next = newnode ;
Newnode -> data = x ;
Newnode -> next = p ->next ;
P -> next = L ;
Newnode -> data = x ;
Newnode -> next = p ->node ;
P -> nextnode = next ;
Newnode -> data = x ;
Newnode -> next = p ->next ;
P -> next = newnode ;
Which of the following is application of Singly Linked List?
moving pages forward and backward in browser
Giving chance to each player in a multi player game
Implementing Stack
What advantage does a linked list have over an array?
A linked list can give you the data faster
It is easier to use
A linked list is not of a fixed size
It's better
What is the best and worst-case time complexity for searching for a value in a Linked List?
O(1) and O(log n)
O(1) and O(1)
O(1) and O(n^2)
O(1) and O(n)
What does the following function do for a given Linked List with first node as head?
Prints all nodes of linked lists
Prints alternate nodes of Linked List
Prints alternate nodes in reverse order
Prints all nodes of linked list in reverse order
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
