Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. public static int two1 (int n) {
  2. if (n == 0) {
  3. return 1;
  4. } else {
  5. return 2 * two1(n - 1);
  6. }
  7. }
  8.  
  9. public static int two2 (int n) {
  10. if (n == 0) {
  11. return 1;
  12. } else {
  13. return two2(n - 1) + two2(n - 1);
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement