Bifalgorithm post
Hi everyone, let's solve this. Identify the time complexity of binary search. Options a. Order of n, b. Order of log n, c. Order of n log n, d. Order of 1. Answer, option b. Order of log n. Explanation, in binary search, with each step the search space is divided into half. So the number of steps required grows in proportion to the logarithm of n. Therefore, the time complexity is order of log n. Thank you. Please like, share and subscribe.
Hi everyone, let's solve this. Identify the time complexity of binary search. Options a. Order of n, b. Order of log n, c. Order of n log n, d. Order of 1. Ans…
Ideas in this flowchart
- Time Complexity of Binary Search
- Options
- Order of n
- Order of log n
- Order of n log n
- Order of 1
- Correct Answer
- Explanation
- Search space halved each step
- Steps grow with log n