Created
March 14, 2014 04:25
-
-
Save rahulaga/9542128 to your computer and use it in GitHub Desktop.
Recursion
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
public static void recurse(int n) { | |
if (n <= 0) | |
return; | |
else { | |
n=n-1; | |
recurse(n); | |
System.out.println(n); | |
return; | |
} | |
} | |
public static void recurse(int n) { | |
if (n <= 0) | |
return; | |
else { | |
System.out.println(n); | |
n=n-1; | |
recurse(n); | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment