Question: Using recursion in java complete the method recursiveWrite which takes an integer as the parameter. Count down from the number ( putting a space between

Using recursion in java complete the method recursiveWrite which takes an integer as the parameter.
Count down from the number (putting a space between each number) until you get to 1.
Print 1 again and count back up.
Test Case 1
In the first test case, n has the value 3. Running your program should produce the following output:
321123
Test Case 2
In the second test case, n has the value 4. Running your program should produce the following output:
43211234
Test Case 3
In the third test case, n has the value 5. Running your program should produce the following output:
5432112345

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!