Question 34 --- 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.
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 head to tail, checking each node's value until the target is found or the list ends. Statement (II) is also correct: deletion in a linked list is more efficient than in an array because once you have a reference to the node before the one to delete, you only need to update pointers (O(1) operation), whereas array deletion requires shifting all subsequent elements (O(n) operation).
Step-by-step Derivation:
Statement (I) Analysis:
- Linked lists are sequential data structures that can be traversed linearly.
- Linear search requires checking elements one-by-one until the target is found.
- This is naturally achievable in a linked list by following the next pointers.
- Conclusion: TRUE
Statement (II) Analysis:
- Array deletion: To delete element at index i, you must shift all elements from i+1 to end one position left. Time complexity: O(n).
- Linked list deletion: If you have a pointer to the node before the target node, update its next pointer to skip the target node. Time complexity: O(1) for the actual deletion (after finding the node).
- Finding the node takes O(n) in worst case for both, but the deletion operation itself is inherently easier in linked lists.
- Conclusion: TRUE
Final Answer: Both statements are correct → Option B