1.

What will be time complexity when binary search is applied on a linked list?(a) O(1)(b) O(n)(c) O(n^2)(d) O(n^3)This question was posed to me in quiz.My doubt is from Search an Element in a Linked List using Recursion in section Recursion of Data Structures & Algorithms II

Answer»

Right option is (B) O(n)

EASY EXPLANATION - The time complexity will be O(n) when BINARY search is applied on a linked list.



Discussion

No Comment Found

Related InterviewSolutions