QUESTION 11 Which of the below given statement(s) is/are correct about linked list?
Micron technical mcq question, verified with a worked answer. Free to practise - no sign-up.
QUESTION 11
Which of the below given statement(s) is/are correct about linked list?
I) Linear search can be implemented using linked list.
II) Deletion of an element is easy in linked list as compare to array.
Show answer & explanation
Statement I is correct: linear search can absolutely be implemented on a linked list by traversing nodes sequentially from the head until the target value is found. Statement II is also correct: deletion in a linked list is easier than in an array because it only requires updating pointers (O(1) after finding the node), whereas array deletion requires shifting all subsequent elements (O(n)). Both statements are valid properties of linked lists.
Step-by-step Derivation:
Analyze each statement:
Statement I: Linear search using linked list
- Linear search means sequentially checking each element until found or end reached.
- In a linked list, we can traverse from head → node1 → node2 → ... → nodeN using next pointers.
- Time complexity: O(n) in worst case (same as array).
- This is feasible and commonly done.
- Statement I: TRUE ✓
Statement II: Deletion is easier in linked list vs array
- Array deletion: To remove element at index i, must shift all elements after i one position left (O(n) time).
- Linked list deletion: Once the node is located, only need to update pointers:
- temp = nodeToDelete
- prevNode.next = nodeToDelete.next
- free(temp)
- Time: O(1) after finding the node, O(n) if searching first.
- The pointer manipulation is conceptually simpler and more efficient than shifting.
- Statement II: TRUE ✓
Conclusion: Both statements are correct → Answer is D.