Explore BrainMass
Share

Explore BrainMass

    Java Recursion Problem

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Design a Java application that accepts a positive integer n > 1 as a command line parameter and outputs all strictly increasing integer sequences starting with 1 and ending with n.

    For example, for n=5 the following sequences should be output (not necessarily in the shown order):

    1 5
    1 2 5
    1 3 5
    1 2 3 5
    1 4 5
    1 2 4 5
    1 3 4 5
    1 2 3 4 5

    © BrainMass Inc. brainmass.com October 9, 2019, 10:23 pm ad1c9bdddf
    https://brainmass.com/computer-science/java/java-recursion-problem-218882

    Solution Preview

    Please see the attachment.

    The system has problem and I can not upload my java source code. So I paste my java source code Sequence.java here.
    You can compile ...

    Solution Summary

    This solution contains a Java application that commands a line parameter and outputs all strictly increasing integer sequences starting with 1 and ending with n.

    $2.19