Search:

Type: Posts; User: exodus2041

Search: Search took 0.11 seconds.

  1. Replies
    3
    Views
    357

    Re: How to create this recursive method.

    My method so far.

    package javaapplication1;

    /**
    *
    * @author Gordon
    */
    public class JavaApplication1 {
  2. Replies
    3
    Views
    357

    Re: How to create this recursive method.

    My method so far.
    Still working on it.

    public class JavaApplication1 {


    public static void main(String[] args) {

    sum(1,0,4);
    }
  3. Replies
    3
    Views
    357

    How to create this recursive method.

    I need to write a function which, taking a positive integer n as input,
    and finds all sets of numbers that sum up to n.
    For example, n=4, the printing result will be:
    4
    3,1
    2,2
    2,1,1
    1,1,1,1
    ...
Results 1 to 3 of 3