...
UNIX-Operating-System
October 18, 2023
UGC NET CS 2014 June-paper-2
October 18, 2023
UNIX-Operating-System
October 18, 2023
UGC NET CS 2014 June-paper-2
October 18, 2023

Nielit STA [02-12-2018]

Question 2
Which among the following algorithm can’t be used with linked list?
A
Binary search
B
Linear Search
C
Insertion sort
D
Merge Sort
Question 2 Explanation: 
→ Binary search increases the traversal steps per element in linked list just to find the middle element. This makes it slow and inefficient. Whereas the binary search on an array is fast and efficient because of its ability to access any element in the array in constant time.
→ Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes some other algorithms (such as quicksort) perform poorly, and others (such as heapsort) completely impossible.
→ Insertion sort & Linear search can use linked list.
Note:But Binary search also can implement using linked list but it takes O(n) time complexity.
Correct Answer: A
Question 2 Explanation: 
→ Binary search increases the traversal steps per element in linked list just to find the middle element. This makes it slow and inefficient. Whereas the binary search on an array is fast and efficient because of its ability to access any element in the array in constant time.
→ Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes some other algorithms (such as quicksort) perform poorly, and others (such as heapsort) completely impossible.
→ Insertion sort & Linear search can use linked list.
Note:But Binary search also can implement using linked list but it takes O(n) time complexity.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!