Greetings. I am new to this board, but I'll try to be as clear as possible.

Here's the deal. Suppose I have the following array:

I want to obtain a bidimensional array from that array, with the following elements:Code:int old_array [] = {1,2}

Likewise, if I had:Code:{{1},{2},{1,2}}

I'd want to obtain:Code:int old_array [] = {1,2,3}

So, basically, I'm searching for an algorithm that allows me to obtain every single possible combination of elements from the old array: every combination of 1 element, every combination of 2 elements, and so forth.Code:{{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}

Thus, I have two questions:

1) I know that what I want to obtain has a specific mathematical term in English, but what is that term exactly?

2) Do you happen to know how I can code such algorithm? If so, how?

Thank you in advance. I hope I've made myself clear enough.