Probably that :
function binarySearch(list, target) { if (list.length === 0) { return false; } let midpoint = Math.floor(list.length / 2); if (list[midpoint] === target) { return true; } const left = list.slice(midpoint -1); const right = list.slice(midpoint +1, list.length); return binarySearch(right, target) || binarySearch(left, target); }
Thank you for your response. I really appreciate the help
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Probably that :
Thank you for your response. I really appreciate the help