Search:

Type: Posts; User: helloworld922

Search: Search took 0.08 seconds.

  1. Re: hey guys new to recursion any ideas for me?

    Your printing out statement in sum can never be reached (can you see why?). Java's compiler recognizes this and will through an error. Put that print out statement somewhere inside your main method,...
  2. Re: hey guys new to recursion any ideas for me?

    Your algorithm needs a little work. Try this:

    1. See if your current number n is 1. If it is, return 1.
    2. Otherwise, sum(n) = sum(n-1) + n
Results 1 to 2 of 2