Question DSA-SRCH-0054
MediumWhat is the time complexity of finding how many times x occurs in a sorted array?
- A.
O(log n), using two binary searches for the first and last positions
- B.
O(1)
- C.
Sign up free to see the answer and a step-by-step explanation.