Binary Search
AP Computer Science Principles · Flashcards · Application
AP COMPUTER SCIENCE PRINCIPLES · FLASHCARDS
Card 1
of 10
0 got it
0 to review
Current
Got it
Still learning
Not seen
QUESTION
What happens if the target is less than the middle element in binary search?
QUESTION
In binary search, what happens if 'low' equals 'high'?
QUESTION
Determine the middle index for 'low' = 2, 'high' = 6.
Tap to flip before you grade
ANSWER
Middle index = 4. Using the formula
(
2
+
6
)
/
2
=
4
(2 + 6) / 2 = 4
(
2
+
6
)
/2
=
4
.
Swipe → got it · swipe ← still learning
Got it
Still learning
Flip Card
Previous card
Next card