Skip to content

Instantly share code, notes, and snippets.

View hartz89's full-sized avatar

Ryan Hartzfeld hartz89

  • Disney
  • New York
View GitHub Profile
@hartz89
hartz89 / binarySearch.js
Last active June 21, 2019 20:36
Implementation of a binary insertion sort in es6.
export const getInsertPosition = (value, target) => {
if (target.length === 0) {
return 0;
}
if (value < target[0]) {
return 0;
}
const lastIndex = target.length - 1;