Last active
April 24, 2020 16:42
-
-
Save adslaton/6d4049fca990d61350434a01aea06073 to your computer and use it in GitHub Desktop.
Big O Logarithmic Time
This file contains hidden or 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
// 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