Skip to content
TryAlgoViz
Algorithms
Articles
CS Fundamentals
Problems
Roadmap
Dashboard
Theme
Binary Search — TryAlgoViz
Binary Search
easy
Description
Hints
Discussion
Visual examples
Example 1
Input
-1
0
0
1
3
2
5
3
9
4
12
5
Output
4
Example 2
Input
-1
0
0
1
3
2
5
3
9
4
12
5
Output
-1
Python
Reset
Run
Ctrl+Enter
Loading editor…
Test Case 1
Test Case 2
Input
-1
0
0
1
3
2
5
3
9
4
12
5
target
9
Expected Output
4