Skip to content

Instantly share code, notes, and snippets.

View prav-raghu's full-sized avatar
🐍
Working from home

Prav prav-raghu

🐍
Working from home
View GitHub Profile
@prav-raghu
prav-raghu / iterativeBinarySearch.js
Created March 31, 2022 12:07
iterativeBinarySearch
var array = [1,2,3,4,5]
let iterativeFunction = function (arr, x) {
let start=0, end=arr.length-1;
// Iterate while start not meets end
while (start<=end){
// Find the mid index