Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all combinations in arraylist recursively

Tags:

java

recursion

I'm completely lost on this. I can do this iteratively, but recursion is new to me. If I'm given an arraylist with 1, 2, 3 inside of it, the total possible combos with repeats is 27.

111, 112, 113, 121, 122, 123, etc...

how can I find this recursively? I'd show my code but I'm not even close to getting the concept...

like image 402
AlldaRage Avatar asked Mar 24 '15 04:03

AlldaRage


1 Answers

You can use this concept and make your own recursive function. using that you can get all possible combinations.

like image 112
Logicbomb Avatar answered Sep 28 '22 23:09

Logicbomb