Hi Guys,
I'd like to ask something about recursion, using C.
I think it'd be best to describe the question by giving an example.
I wrote a recursive function that gets set of N numbers, and stores all subsets in an array (i.e. for "123", it stores, "", "1", "2", "3", "12", "23", 13", 123").
however, since I didn't want each function call to allocate memory for N-size array (because then I'd have in Stack N * 2^N memory occupation), I allocated a N * 2^N array before I started the recursion, and each function call updated that array.
Is there a way to have the recursive function calls allocate their on arrays without too much memory occupations?
thanks!