Problem

Given the definition of a 2D array such as the followingString[][] data = { {"A&#3...

Given the definition of a 2D array such as the following

String[][] data = {	    {"A","B"},	    {"1","2"},	    {"XX","YY","ZZ"}	 };
write a recursive program that outputs all combinations of each subarray in order. In the above example, the desired output (although it doesn’t have to be in this order) is:
A 1 XXA 1 YYA 1 ZZA 2 XXA 2 YYA 2 ZZB 1 XXB 1 YYB 1 ZZB 2 XXB 2 YYB 2 ZZ

Your program should work with arbitrarily sized arrays in either dimension. For example, the following data

String[][] data = {		  {"A"},		  {"1"},		  {"2"},		  {"XX","YY"}	       };
should output:
A 1 2 XXA 1 2 YY

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT