483 views
0 votes
0 votes

Why ?

Isnt Option A true using "Binary search" 

1 Answer

Best answer
1 votes
1 votes
Because O(logn) time is required only to find the element not to delete it.. To delete it we require to move the other elements to their new position which would require additional time. if it would have been the last elemnt then it would be O(logn) as we search the elemnt and delete it.

Option c is correct As in a sorted array to find the element at index i it requires only O(1) time..
selected by

Related questions

0 votes
0 votes
1 answer
1
Rackson asked Jan 12, 2019
963 views
0 votes
0 votes
1 answer
2
0 votes
0 votes
0 answers
3
0 votes
0 votes
1 answer
4
pradeepchaudhary asked Aug 19, 2018
813 views
What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?a) O(1)b) O(n)c)...