Last active
June 17, 2020 13:04
-
-
Save speckworks/13755468d93f7706469db37a6cc24560 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
//In this Algorithm there is only on variable "i" declared and it contains a number. | |
//Even though that number can increase to an arbitrarily large value (according to input n), | |
//Space Complexity is constant since it's just 1 value that is changing. | |
const logUpToN(n) => { | |
for(let i = 1; i <= n; i++){ | |
console.log(i) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment