This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer