1What are the two main components of a node in a singly linked list?
A.Data and Index
B.Value and Reference Count
C.Data and Next Pointer
D.Head and Tail
Correct Answer: Data and Next Pointer
Explanation: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.
Incorrect! Try again.
2Which of the following best describes the memory allocation of a linked list?
A.Static and Contiguous
B.Dynamic and Contiguous
C.Static and Non-contiguous
D.Dynamic and Non-contiguous
Correct Answer: Dynamic and Non-contiguous
Explanation: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.
Incorrect! Try again.
3What is the time complexity to access the Nth element in a singly linked list?
A.O(1)
B.O(n)
C.O(log n)
D.O(n^2)
Correct Answer: O(n)
Explanation: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.
Incorrect! Try again.
4Which pointer is required to maintain access to the entire linked list?
A.Tail pointer
B.Null pointer
C.Head pointer
D.Middle pointer
Correct Answer: Head pointer
Explanation:The Head pointer stores the address of the first node. Without it, the rest of the list cannot be accessed.
Incorrect! Try again.
5In C, which function is commonly used to dynamically allocate memory for a new node?
A.alloc()
B.create()
C.malloc()
D.new()
Correct Answer: malloc()
Explanation:malloc() (memory allocation) is the standard C library function used to allocate a block of memory on the heap.
Incorrect! Try again.
6What is the value of the 'next' pointer in the last node of a grounded singly linked list?
A.Address of the Head
B.Address of the previous node
C.NULL
D.Garbage value
Correct Answer: NULL
Explanation:In a grounded (standard) singly linked list, the last node's next pointer is set to NULL to indicate the end of the list.
Incorrect! Try again.
7Which of the following is a disadvantage of a singly linked list compared to an array?
A.Fixed size
B.Memory wastage due to pointers
C.Expensive insertion at the beginning
D.Cannot expand dynamically
Correct Answer: Memory wastage due to pointers
Explanation:Linked lists require extra memory for every element to store the pointer to the next node, unlike arrays which only store data.
Incorrect! Try again.
8In a self-referential structure definition for a node, what is the data type of the pointer member?
A.void*
B.int*
C.struct node*
D.char*
Correct Answer: struct node*
Explanation:A node must point to another object of the same type, so the pointer is of type 'struct node*'.
Incorrect! Try again.
9What condition indicates that a singly linked list is empty?
A.head->next == NULL
B.head == NULL
C.head->data == 0
D.head == tail
Correct Answer: head == NULL
Explanation:If the head pointer is NULL, it means it is not pointing to any node, indicating the list is empty.
Incorrect! Try again.
10What is the time complexity for inserting a node at the beginning of a singly linked list?
A.O(1)
B.O(n)
C.O(log n)
D.O(n log n)
Correct Answer: O(1)
Explanation:Insertion at the beginning involves only pointer updates (new node points to current head, head points to new node), taking constant time.
Incorrect! Try again.
11When traversing a singly linked list, what is the condition to stop the loop?
A.ptr == head
B.ptr->next == NULL
C.ptr == NULL
D.ptr->data == NULL
Correct Answer: ptr == NULL
Explanation:The traversal loop usually runs while ptr != NULL. When ptr becomes NULL, the end of the list has been reached and processed.
Incorrect! Try again.
12Which scenario results in an 'Overflow' condition in a linked list?
A.The list is empty
B.The head pointer is lost
C.The Free Storage Pool (Avail List) is empty
D.The list contains a loop
Correct Answer: The Free Storage Pool (Avail List) is empty
Explanation:Overflow occurs during insertion if the system has no more dynamic memory available to allocate for a new node.
Incorrect! Try again.
13What is the correct order of operations to insert a node 'NEW' between node 'A' and node 'B' (where A->next is B)?
A.A->next = NEW; NEW->next = B;
B.NEW->next = A; A->next = B;
C.NEW->next = B; A->next = NEW;
D.B->next = NEW; NEW->next = A;
Correct Answer: NEW->next = B; A->next = NEW;
Explanation: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.
Incorrect! Try again.
14What is the time complexity of deleting the last node in a singly linked list (without a tail pointer)?
A.O(1)
B.O(n)
C.O(log n)
D.O(n^2)
Correct Answer: O(n)
Explanation:You must traverse the entire list to find the second-to-last node to update its pointer to NULL, resulting in O(n) complexity.
Incorrect! Try again.
15Which function is used to release the memory of a deleted node back to the system?
A.delete()
B.remove()
C.free()
D.dalloc()
Correct Answer: free()
Explanation:In C, free() is used to deallocate memory previously allocated by malloc(), preventing memory leaks.
Incorrect! Try again.
16What is a 'Header Linked List'?
A.A list where the last node points to the head
B.A list that contains a special node at the beginning containing metadata
C.A list with two pointers per node
D.A list sorted in ascending order
Correct Answer: A list that contains a special node at the beginning containing metadata
Explanation: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.
Incorrect! Try again.
17In a 'Grounded' Header Linked List, what does the last node point to?
A.The Header Node
B.The First Data Node
C.NULL
D.Random Memory
Correct Answer: NULL
Explanation:Grounded means the list terminates. Even though it has a header, the last node points to NULL.
Incorrect! Try again.
18In a 'Circular' Header Linked List, what does the last node point to?
A.NULL
B.The First Data Node
C.The Header Node
D.The Last Node itself
Correct Answer: The Header Node
Explanation:In a circular header list, the last node points back to the header node, forming a complete cycle.
Incorrect! Try again.
19What is the primary advantage of using a Header node?
A.It uses less memory
B.It simplifies insertion and deletion algorithms by removing special cases for the first node
C.It allows binary search
D.It automatically sorts data
Correct Answer: It simplifies insertion and deletion algorithms by removing special cases for the first node
Explanation: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.
Incorrect! Try again.
20What defines a Circular Linked List (without a header)?
A.Head is NULL
B.Last node points to NULL
C.Last node points to the first node
D.Nodes are arranged in a circle visually only
Correct Answer: Last node points to the first node
Explanation:A circular linked list connects the end of the list back to the beginning, allowing continuous traversal.
Incorrect! Try again.
21What is the loop termination condition when traversing a circular linked list starting from head?
A.ptr == NULL
B.ptr->next == NULL
C.ptr->next == head
D.ptr == head (after starting)
Correct Answer: ptr->next == head
Explanation:You stop when the next pointer points back to the starting head node, indicating a full circle has been made.
Incorrect! Try again.
22Which data structure allows traversal in both forward and backward directions?
A.Singly Linked List
B.Circular Singly Linked List
C.Two-way (Doubly) Linked List
D.Stack
Correct Answer: Two-way (Doubly) Linked List
Explanation:A two-way or doubly linked list has next and prev pointers, allowing bidirectional traversal.
Incorrect! Try again.
23How many pointers does a standard node in a Doubly Linked List contain?
A.One
B.Two
C.Three
D.Zero
Correct Answer: Two
Explanation:It contains a pointer to the previous node and a pointer to the next node.
Incorrect! Try again.
24What is the memory overhead of a Doubly Linked List compared to a Singly Linked List?
A.50% less
B.Same
C.Requires one extra pointer per node
D.Requires double the data space
Correct Answer: Requires one extra pointer per node
Explanation:A DLL requires storage for a prev pointer in every node, which is the primary overhead compared to an SLL.
Incorrect! Try again.
25In a Doubly Linked List, to delete a node P (not first/last), which operations are needed?
Explanation: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.
Incorrect! Try again.
26What is the time complexity to delete a node in a Doubly Linked List if the pointer to that node is given?
A.O(1)
B.O(n)
C.O(log n)
D.O(n log n)
Correct Answer: O(1)
Explanation: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.
Incorrect! Try again.
27Which list is best suited for implementing a 'Back' and 'Forward' button in a browser?
A.Singly Linked List
B.Circular Linked List
C.Doubly Linked List
D.Queue
Correct Answer: Doubly Linked List
Explanation:A doubly linked list allows moving forward and backward through the history efficiently.
Incorrect! Try again.
28In a Circular Doubly Linked List, what does the left (prev) pointer of the first node point to?
A.NULL
B.The second node
C.The last node
D.The first node
Correct Answer: The last node
Explanation:Being circular, the previous pointer of the head connects to the tail, and the next pointer of the tail connects to the head.
Incorrect! Try again.
29Which condition indicates 'Underflow' in a linked list?
A.Inserting into a full memory
B.Deleting from an empty list
C.Traversing past the end
D.Allocating NULL
Correct Answer: Deleting from an empty list
Explanation:Underflow occurs when you attempt to perform a deletion operation on a list that has no nodes.
Incorrect! Try again.
30If a Singly Linked List is effectively used as a Stack, which end is most efficient for Push and Pop?
A.Push at End, Pop at Start
B.Push at Start, Pop at End
C.Push at Start, Pop at Start
D.Push at End, Pop at End
Correct Answer: Push at Start, Pop at Start
Explanation:Operations at the head (start) of an SLL are O(1). Operations at the end are O(n) without a tail pointer.
Incorrect! Try again.
31Can Binary Search be effectively applied to a standard Linked List?
A.Yes, with O(log n) complexity
B.Yes, with O(n) complexity
C.No, because random access is not allowed
D.No, because it's not sorted
Correct Answer: No, because random access is not allowed
Explanation:Binary search requires jumping to the middle index, which is O(1) in arrays but O(n) in linked lists, negating the efficiency benefit.
Incorrect! Try again.
32What happens if you free a node without updating the pointers pointing to it?
A.Memory Leak
B.Dangling Pointer
C.Stack Overflow
D.List becomes circular
Correct Answer: Dangling Pointer
Explanation:The previous nodes still hold the address of the memory that has been freed. Accessing this causes undefined behavior (Dangling Pointer).
Incorrect! Try again.
33What is the logical structure of a linked list?
A.Non-Linear
B.Linear
C.Hierarchical
D.Grid
Correct Answer: Linear
Explanation:Although stored non-contiguously, the nodes form a linear sequence logically.
Incorrect! Try again.
34In a Doubly Linked List, if p points to a node, what is p->next->prev equivalent to (assuming p is not last)?
A.p
B.p->next
C.p->prev
D.NULL
Correct Answer: p
Explanation:The next pointer goes to the successor, and that successor's prev pointer points back to the original node p.
Incorrect! Try again.
35Which algorithm is commonly used to detect a cycle (loop) in a linked list?
A.Binary Search
B.Floyd’s Cycle-Finding Algorithm (Tortoise and Hare)
C.Dijkstra's Algorithm
D.Quick Sort
Correct Answer: Floyd’s Cycle-Finding Algorithm (Tortoise and Hare)
Explanation:This algorithm uses a slow pointer and a fast pointer. If they meet, a cycle exists.
Incorrect! Try again.
36To reverse a singly linked list, how many pointers are typically required during the traversal?
A.1
B.2
C.3
D.4
Correct Answer: 3
Explanation:Typically three pointers are used: prev, current, and next to reverse the link direction while traversing.
Incorrect! Try again.
37What is a Sentinel node?
A.A node responsible for memory allocation
B.A dummy node (like a header) used to simplify boundary conditions
C.The last node in a list
D.A node with NULL data
Correct Answer: A dummy node (like a header) used to simplify boundary conditions
Explanation:Sentinel nodes are dummy nodes placed at the head or tail to eliminate checks for NULL pointers or empty lists during operations.
Incorrect! Try again.
38Which polynomial operation is most efficiently handled by linked lists?
A.Evaluation
B.Roots finding
C.Addition of sparse polynomials
D.Graphing
Correct Answer: Addition of sparse polynomials
Explanation:Linked lists are excellent for representing sparse polynomials (where many coefficients are zero) and adding them by traversing terms.
Incorrect! Try again.
39In a Two-way list, inserting a node at the beginning requires changing how many existing pointers (excluding the new node's pointers)?
A.1
B.2
C.3
D.
Correct Answer: 2
Explanation: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.
Incorrect! Try again.
40What data type is head typically declared as?
A.int
B.struct node
C.struct node*
D.void
Correct Answer: struct node*
Explanation:The head is a pointer variable that holds the address of the first node structure.
Incorrect! Try again.
41If ptr is a pointer to a node, how do you access the data of that node in C?
A.ptr.data
B.ptr->data
C.*ptr.data
D.&ptr.data
Correct Answer: ptr->data
Explanation:The arrow operator (->) is used to access members of a structure via a pointer.
Incorrect! Try again.
42Which operation typically runs faster on a Circular Linked List than a standard Singly Linked List?
A.Finding the Nth node
B.Sorting
C.Deleting the first node while maintaining a pointer to the last node
D.Binary Search
Correct Answer: Deleting the first node while maintaining a pointer to the last node
Explanation: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.
Incorrect! Try again.
43Which of the following is NOT a type of linked list?
A.Singly Linked List
B.Doubly Linked List
C.Circular Linked List
D.Indexed Linked List
Correct Answer: Indexed Linked List
Explanation:While variations exist, 'Indexed Linked List' is not a standard fundamental type; linked lists do not inherently support indexing.
Incorrect! Try again.
44Memory for a linked list node is allocated from which segment?
A.Stack
B.Heap
C.Data Segment
D.Code Segment
Correct Answer: Heap
Explanation:Dynamic memory allocation (via malloc) occurs in the Heap segment of memory.
Incorrect! Try again.
45What is the main disadvantage of a Circular Linked List?
A.Cannot traverse backwards
B.Risk of infinite loops during traversal if not handled carefully
C.Requires double memory
D.Insertion is O(n)
Correct Answer: Risk of infinite loops during traversal if not handled carefully
Explanation:Because there is no NULL terminator, a poorly written traversal loop can run forever.
Incorrect! Try again.
46To concatenate two singly linked lists (List A and List B) into one, what operation is required?
A.Copy all nodes of B to A
B.Traverse A to the end and make the last node point to head of B
C.Make head of A point to head of B
D.Traverse B to end and point to A
Correct Answer: Traverse A to the end and make the last node point to head of B
Explanation:You simply link the end of the first list to the beginning of the second list.
Incorrect! Try again.
47How do you represent a Polynomial using a linked list?
A.Nodes store coefficient and exponent: [3,2] -> [5,0] -> NULL
B.Nodes store value of x
C.Array of integers
D.Nodes store only coefficients
Correct Answer: Nodes store coefficient and exponent: [3,2] -> [5,0] -> NULL
Explanation:Each node typically stores the coefficient and the exponent power to represent a term in the polynomial.
Incorrect! Try again.
48In a doubly linked list, what does head->prev point to?
A.NULL
B.The second node
C.The tail
D.Random garbage
Correct Answer: NULL
Explanation:In a non-circular doubly linked list, the previous pointer of the first node is NULL.
Incorrect! Try again.
49When deleting a node from a linked list, why is a temporary pointer often used?
A.To speed up deletion
B.To store the address of the node to be freed so links can be rewired first
C.To allocate new memory
D.It is required by the C syntax
Correct Answer: To store the address of the node to be freed so links can be rewired first
Explanation: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.
Incorrect! Try again.
50Which complexity best describes sorting a Linked List using Merge Sort?
A.O(n)
B.O(n^2)
C.O(n log n)
D.O(1)
Correct Answer: O(n log n)
Explanation:Merge sort is the preferred sorting algorithm for linked lists and operates in O(n log n) time.
Incorrect! Try again.
Give Feedback
Help us improve by sharing your thoughts or reporting issues.