Created
February 27, 2021 04:46
-
-
Save eengineergz/e9bd6337c17f1623a4da088574ed0d8e to your computer and use it in GitHub Desktop.
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
// O(n * log(n)) | |
function loglinear(n) { | |
if (n <= 1) return; | |
for (let i = 1; i <= n; i++) { | |
console.log(i); | |
} | |
loglinear(n / 2); | |
loglinear(n / 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment