Skip to content

Instantly share code, notes, and snippets.

@adslaton
Last active April 24, 2020 16:42
Show Gist options
  • Save adslaton/6d4049fca990d61350434a01aea06073 to your computer and use it in GitHub Desktop.
Save adslaton/6d4049fca990d61350434a01aea06073 to your computer and use it in GitHub Desktop.
Big O Logarithmic Time
// Represents an algorithm that runs in proportionally to the logarithm of the input size
const f = (n) => {
for (let i = 1; i < n.length; i = i * 2) { //
console.log(array[n]); // O(log(n))
} //
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment