Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
What are the two main components of a node in a singly linked list?
Not quite. Try another option.
Answer: Data and Next Pointer
A standard node in a singly linked list consists of the data element and a pointer (often called 'next') that stores the address of the next node.
Question 2 of 50
Which of the following best describes the memory allocation of a linked list?
Not quite. Try another option.
Answer: Dynamic and Non-contiguous
Linked lists are dynamic data structures where memory is allocated at runtime, and nodes can be stored in non-contiguous memory locations linked by pointers.
Question 3 of 50
What is the time complexity to access the Nth element in a singly linked list?
Not quite. Try another option.
Answer: O(n)
Linked lists do not support random access. To find the Nth element, you must traverse from the head through N nodes, resulting in linear time complexity.
Question 4 of 50
Which pointer is required to maintain access to the entire linked list?
Not quite. Try another option.
Answer: Head pointer
The Head pointer stores the address of the first node. Without it, the rest of the list cannot be accessed.
Question 5 of 50
In C, which function is commonly used to dynamically allocate memory for a new node?
Not quite. Try another option.
Answer: malloc()
malloc() (memory allocation) is the standard C library function used to allocate a block of memory on the heap.
Question 6 of 50
What is the value of the 'next' pointer in the last node of a grounded singly linked list?
Not quite. Try another option.
Answer: NULL
In a grounded (standard) singly linked list, the last node's next pointer is set to NULL to indicate the end of the list.
Question 7 of 50
Which of the following is a disadvantage of a singly linked list compared to an array?
Not quite. Try another option.
Answer: Memory wastage due to pointers
Linked lists require extra memory for every element to store the pointer to the next node, unlike arrays which only store data.
Question 8 of 50
In a self-referential structure definition for a node, what is the data type of the pointer member?
Not quite. Try another option.
Answer: struct node*
A node must point to another object of the same type, so the pointer is of type 'struct node*'.
Question 9 of 50
What condition indicates that a singly linked list is empty?
Not quite. Try another option.
Answer: head == NULL
If the head pointer is NULL, it means it is not pointing to any node, indicating the list is empty.
Question 10 of 50
What is the time complexity for inserting a node at the beginning of a singly linked list?
Not quite. Try another option.
Answer: O(1)
Insertion at the beginning involves only pointer updates (new node points to current head, head points to new node), taking constant time.
Question 11 of 50
When traversing a singly linked list, what is the condition to stop the loop?
Not quite. Try another option.
Answer: ptr == NULL
The traversal loop usually runs while ptr != NULL. When ptr becomes NULL, the end of the list has been reached and processed.
Question 12 of 50
Which scenario results in an 'Overflow' condition in a linked list?
Not quite. Try another option.
Answer: The Free Storage Pool (Avail List) is empty
Overflow occurs during insertion if the system has no more dynamic memory available to allocate for a new node.
Question 13 of 50
What is the correct order of operations to insert a node 'NEW' between node 'A' and node 'B' (where A->next is B)?
Not quite. Try another option.
Answer: NEW->next = B; A->next = NEW;
You must first link the NEW node to B (preserving the rest of the list) before linking A to the NEW node. Otherwise, the reference to B is lost.
Question 14 of 50
What is the time complexity of deleting the last node in a singly linked list (without a tail pointer)?
Not quite. Try another option.
Answer: O(n)
You must traverse the entire list to find the second-to-last node to update its pointer to NULL, resulting in O(n) complexity.
Question 15 of 50
Which function is used to release the memory of a deleted node back to the system?
Not quite. Try another option.
Answer: free()
In C, free() is used to deallocate memory previously allocated by malloc(), preventing memory leaks.
Question 16 of 50
What is a 'Header Linked List'?
Not quite. Try another option.
Answer: A list that contains a special node at the beginning containing metadata
A header linked list contains a special header node at the start which often stores information like the number of nodes, but does not contain actual list data.
Question 17 of 50
In a 'Grounded' Header Linked List, what does the last node point to?
Not quite. Try another option.
Answer: NULL
Grounded means the list terminates. Even though it has a header, the last node points to NULL.
Question 18 of 50
In a 'Circular' Header Linked List, what does the last node point to?
Not quite. Try another option.
Answer: The Header Node
In a circular header list, the last node points back to the header node, forming a complete cycle.
Question 19 of 50
What is the primary advantage of using a Header node?
Not quite. Try another option.
Answer: It simplifies insertion and deletion algorithms by removing special cases for the first node
With a header node, the 'first' data node is actually the second node in the structure, so insertion/deletion at the logical beginning acts like insertion/deletion in the middle.
Question 20 of 50
What defines a Circular Linked List (without a header)?
Not quite. Try another option.
Answer: Last node points to the first node
A circular linked list connects the end of the list back to the beginning, allowing continuous traversal.
Question 21 of 50
What is the loop termination condition when traversing a circular linked list starting from head?
Not quite. Try another option.
Answer: ptr->next == head
You stop when the next pointer points back to the starting head node, indicating a full circle has been made.
Question 22 of 50
Which data structure allows traversal in both forward and backward directions?
Not quite. Try another option.
Answer: Two-way (Doubly) Linked List
A two-way or doubly linked list has next and prev pointers, allowing bidirectional traversal.
Question 23 of 50
How many pointers does a standard node in a Doubly Linked List contain?
Not quite. Try another option.
Answer: Two
It contains a pointer to the previous node and a pointer to the next node.
Question 24 of 50
What is the memory overhead of a Doubly Linked List compared to a Singly Linked List?
Not quite. Try another option.
Answer: Requires one extra pointer per node
A DLL requires storage for a prev pointer in every node, which is the primary overhead compared to an SLL.
Question 25 of 50
In a Doubly Linked List, to delete a node P (not first/last), which operations are needed?
You must bypass P by linking the previous node's next to P's next, and P's next node's prev to P's prev.
Question 26 of 50
What is the time complexity to delete a node in a Doubly Linked List if the pointer to that node is given?
Not quite. Try another option.
Answer: O(1)
Since you have the pointer to the node, you can access its prev and next immediately to update links, unlike an SLL where you need to traverse to find the predecessor.
Question 27 of 50
Which list is best suited for implementing a 'Back' and 'Forward' button in a browser?
Not quite. Try another option.
Answer: Doubly Linked List
A doubly linked list allows moving forward and backward through the history efficiently.
Question 28 of 50
In a Circular Doubly Linked List, what does the left (prev) pointer of the first node point to?
Not quite. Try another option.
Answer: The last node
Being circular, the previous pointer of the head connects to the tail, and the next pointer of the tail connects to the head.
Question 29 of 50
Which condition indicates 'Underflow' in a linked list?
Not quite. Try another option.
Answer: Deleting from an empty list
Underflow occurs when you attempt to perform a deletion operation on a list that has no nodes.
Question 30 of 50
If a Singly Linked List is effectively used as a Stack, which end is most efficient for Push and Pop?
Not quite. Try another option.
Answer: Push at Start, Pop at Start
Operations at the head (start) of an SLL are O(1). Operations at the end are O(n) without a tail pointer.
Question 31 of 50
Can Binary Search be effectively applied to a standard Linked List?
Not quite. Try another option.
Answer: No, because random access is not allowed
Binary search requires jumping to the middle index, which is O(1) in arrays but O(n) in linked lists, negating the efficiency benefit.
Question 32 of 50
What happens if you free a node without updating the pointers pointing to it?
Not quite. Try another option.
Answer: Dangling Pointer
The previous nodes still hold the address of the memory that has been freed. Accessing this causes undefined behavior (Dangling Pointer).
Question 33 of 50
What is the logical structure of a linked list?
Not quite. Try another option.
Answer: Linear
Although stored non-contiguously, the nodes form a linear sequence logically.
Question 34 of 50
In a Doubly Linked List, if p points to a node, what is p->next->prev equivalent to (assuming p is not last)?
Not quite. Try another option.
Answer: p
The next pointer goes to the successor, and that successor's prev pointer points back to the original node p.
Question 35 of 50
Which algorithm is commonly used to detect a cycle (loop) in a linked list?
Not quite. Try another option.
Answer: Floyd’s Cycle-Finding Algorithm (Tortoise and Hare)
This algorithm uses a slow pointer and a fast pointer. If they meet, a cycle exists.
Question 36 of 50
To reverse a singly linked list, how many pointers are typically required during the traversal?
Not quite. Try another option.
Answer: 3
Typically three pointers are used: prev, current, and next to reverse the link direction while traversing.
Question 37 of 50
What is a Sentinel node?
Not quite. Try another option.
Answer: A dummy node (like a header) used to simplify boundary conditions
Sentinel nodes are dummy nodes placed at the head or tail to eliminate checks for NULL pointers or empty lists during operations.
Question 38 of 50
Which polynomial operation is most efficiently handled by linked lists?
Not quite. Try another option.
Answer: Addition of sparse polynomials
Linked lists are excellent for representing sparse polynomials (where many coefficients are zero) and adding them by traversing terms.
Question 39 of 50
In a Two-way list, inserting a node at the beginning requires changing how many existing pointers (excluding the new node's pointers)?
Not quite. Try another option.
Answer: 2
You must update the head pointer to point to the new node, and the prev pointer of the old first node to point to the new node.
Question 40 of 50
What data type is head typically declared as?
Not quite. Try another option.
Answer: struct node*
The head is a pointer variable that holds the address of the first node structure.
Question 41 of 50
If ptr is a pointer to a node, how do you access the data of that node in C?
Not quite. Try another option.
Answer: ptr->data
The arrow operator (->) is used to access members of a structure via a pointer.
Question 42 of 50
Which operation typically runs faster on a Circular Linked List than a standard Singly Linked List?
Not quite. Try another option.
Answer: Deleting the first node while maintaining a pointer to the last node
If you have a pointer to the last node in a circular list, you can access the head in O(1) via last->next, making operations on the front and back efficient.
Question 43 of 50
Which of the following is NOT a type of linked list?
Not quite. Try another option.
Answer: Indexed Linked List
While variations exist, 'Indexed Linked List' is not a standard fundamental type; linked lists do not inherently support indexing.
Question 44 of 50
Memory for a linked list node is allocated from which segment?
Not quite. Try another option.
Answer: Heap
Dynamic memory allocation (via malloc) occurs in the Heap segment of memory.
Question 45 of 50
What is the main disadvantage of a Circular Linked List?
Not quite. Try another option.
Answer: Risk of infinite loops during traversal if not handled carefully
Because there is no NULL terminator, a poorly written traversal loop can run forever.
Question 46 of 50
To concatenate two singly linked lists (List A and List B) into one, what operation is required?
Not quite. Try another option.
Answer: Traverse A to the end and make the last node point to head of B
You simply link the end of the first list to the beginning of the second list.
Question 47 of 50
How do you represent a Polynomial using a linked list?
Not quite. Try another option.
Answer: Nodes store coefficient and exponent: [3,2] -> [5,0] -> NULL
Each node typically stores the coefficient and the exponent power to represent a term in the polynomial.
Question 48 of 50
In a doubly linked list, what does head->prev point to?
Not quite. Try another option.
Answer: NULL
In a non-circular doubly linked list, the previous pointer of the first node is NULL.
Question 49 of 50
When deleting a node from a linked list, why is a temporary pointer often used?
Not quite. Try another option.
Answer: To store the address of the node to be freed so links can be rewired first
You need to rewire the list (update pointers) to exclude the node. If you don't keep a temp pointer to it, you lose the reference required to free() it.
Question 50 of 50
Which complexity best describes sorting a Linked List using Merge Sort?
Not quite. Try another option.
Answer: O(n log n)
Merge sort is the preferred sorting algorithm for linked lists and operates in O(n log n) time.
That's unit 2
Answer a few questions and your score shows up here.
Nearly through. Did unit 2 of CSE205 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 2 of CSE205 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.