Skip to content
Ravnary
A Knowledge Platform
Categories
Learn
Cheatsheets
Paths
Favourites
Review
Community
Colour theme
Light
Dark
System
Learn
Algorithms
Searching and Simple Sorting
Binary Search
Quiz
Q 01
/ 05
Intermediate
Question 1 of 5. 0 correct, 0 incorrect.
A binary search for a target that is in a sorted array
a
runs while
low <= high
, moving to
mid + 1
or
mid - 1
after each comparison. Which statement is true before every iteration?
a[low] < target < a[high]
The target's index lies between low and high, inclusive
mid moves one place closer to the target each time
The range from low to high holds exactly half as many items as before
Check answer
Home
Learn
Paths
Saved
Community