Skip to content

Instantly share code, notes, and snippets.

@eengineergz
Created February 27, 2021 04:46
Show Gist options
  • Save eengineergz/e9bd6337c17f1623a4da088574ed0d8e to your computer and use it in GitHub Desktop.
Save eengineergz/e9bd6337c17f1623a4da088574ed0d8e to your computer and use it in GitHub Desktop.
// 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