Skip to content

Latest commit

 

History

History
executable file
·
23 lines (10 loc) · 480 Bytes

Binary_Search.md

File metadata and controls

executable file
·
23 lines (10 loc) · 480 Bytes

Binary Search

Problem Statement

Write a function that takes in a sorted array of integers as well as a target integer. The function should use the Binary Search algorithm to nd if the target number is contained in the array and should return its index if it is, otherwise -1.

Sample input: [0, 1, 21, 33, 45, 45, 61, 71, 72, 73], 33

Sample output: 3

Explanation

We can use a Stack here

Solution

Check this Python code.