HSCS.158 Binary Search
0%
Skill Level🔴 Hard
00:00
Progress to Next Level25% to Medium
EasyMediumHardMastery100%

Text-based stimulus: A horizontal index-value diagram for alphabetized interface labels. Top labels are indexes [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]. Bottom labels are values ["arch", "bolt", "chip", "disk", "edge", "font", "grid", "host", "icon", "java"]. It includes a bracket labeled current half-open interval [left, right) from left = 3 to right = 9, with the right boundary shown just after index 8. It places target = "gear" above the table. A JavaScript-style binary search uses half-open bounds [left, right): while (left < right), mid = Math.floor((left + right) / 2). For alphabetized interface labels, values = ["arch", "bolt", "chip", "disk", "edge", "font", "grid", "host", "icon", "java"], target = "gear", left = 3, and right = 9. If target is not equal to values[mid], the code keeps the correct half. Which midpoint and bounds are correct after the comparison?