Hello,
Here below is a list molex_stubs of int arrays.
How to create a list of all permutation of array members where:
- list items are arrays of int
- item length is 14 (number of items in molex_stubs list
- 0-items of int arrays come from molex_stubs[0], 1st-item of int arrays come from molex_stubs[1], etc.
Thanks
- List<int[]> molex_stubs = new List<int[]>()
- {
- new int[] { 3, 1, -1, -3 },
- new int[] { 3, 1, -1, -2 },
- new int[] { 0 },
- new int[] { 4, 3, 1, -1, -3, -4 },
- new int[] { 2, 1, -1, -3 },
- new int[] { 0, -3 },
- new int[] { 3, 0 },
- new int[] { 3, 1, -1, -3 },
- new int[] { 4, 3, 1, -1, -3, -4 },
- new int[] { 3, 0 },
- new int[] { 2, 1, -1, -3 },
- new int[] { 0 },
- new int[] { 0, -3 },
- new int[] { 3, 1, -1, -2 }
- };


ketan borsdiyaRank #2,258 · 624 reputationPosted Oct 4, 2016, 3:55 AM EDT
Pavel106 reputationPosted Oct 4, 2016, 4:33 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Oct 4, 2016, 6:36 AM EDT
Please have a look at below threads-
http://stackoverflow.com/questions/14643009/generate-all-possible-combinations-from-multiple-arrays-c-vb-net
http://www.c-sharpcorner.com/forums/generate-combinations-of-multiple-arrays-dynamically
Pavel106 reputationPosted Oct 4, 2016, 8:17 AM EDT
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Oct 4, 2016, 10:51 AM EDT
First of all: it smells like recursion of course!
Since you also wanted to know the principle, I did my best to explain it human language. I think recursion is very easy most of the times. You only have to grasp two steps:
In human language:
Pavel106 reputationPosted Oct 5, 2016, 4:36 AM EDT
Bikesh, Midhun,
First, thank you for feedback.
Well ... probably I wasn't explicit enough with my last post: I've already found a solution and exposed it in my message.
Regards