Search code examples
binary-searchasymptotic-complexitylinear-search

What is the worst case runtime for Linear search and Binary search?


I believe the worst case asymptotic complexities for Linear search and Binary Search are O(n) and O(lgn) respectively. Am I correct?


Solution

  • Yes, that's correct. Can you find examples of cases that trigger these run times?