Which of the following is true for a sorted list with ‘n’ elements?
A. Insertion in a sorted array takes constant time.
B. Insertion in a sorted linear linked list takes constant time.
C. Searching for a key in a sorted array can be done in O(log n) time.
D. Searching for a key in a sorted linear linked list can be done in O(log n) time.
Answer:C
Which of the following is true for a sorted list with ‘n’ elements?
A. Insertion in a sorted array takes constant time. B. Insertion in a sorted linear linked list takes constant time. C. Searching for a key in a sorted array can be done in O(log n) time. D. Searching for a key in a sorted linear linked list can be done in O(log n) time.