Question DSA-SRCH-0066
HardIn a sorted array, lower_bound(x) returns index 3 and upper_bound(x) returns index 7 (0-based, as in C++). How many times does x occur?
- A.
10
- B.
4
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Searching and Binary Search question
In a sorted array, lower_bound(x) returns index 3 and upper_bound(x) returns index 7 (0-based, as in C++). How many times does x occur?
10
4
Sign up free to see the answer and a step-by-step explanation.
3
5