What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?
What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n? Correct Answer θ(log<sub>2</sub>(n))
The correct answer is option 3:
Key Points
- Binary search has the Worst-case and avg case time complexity O(log2n) and best case O(1) in an array. So, it is can also be written as θ(log2n)
and θ (1).
- No of arithmetic operations will be θ (logn) in the worst case as every comparison needs 2 operations + and / by 2.
মোঃ আরিফুল ইসলাম
Feb 20, 2025