Created
February 7, 2017 21:37
-
-
Save tmosest/485b405a0f993a833dbb160e63d1d716 to your computer and use it in GitHub Desktop.
Linear Space Time
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
/** | |
* This time we are create a variable over and over again in a for loop so we see linear space complexity. | |
*/ | |
public static void printMultiplesOfFive(int n) | |
{ | |
for(int i = 1; i <= n; i++) { | |
int multiple = i * 5; | |
System.out.println(multiple); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment