dynamic allocation in recursion - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

dynamic allocation in recursion

Gregry2Gregry2 Posts: 607Member
I'm back, after so long...

but nvmd about that, this is my question

I've making a recursive algorithm, but have failed to find an alternative to using dynamic arrays in it, for each call requires a variable length array. Can this slip through, just this once?

Secondly, another horror is that each array needs to be initialized, one sneaky trick I thought of is to rather use a large single array instead of three (which each call has), and probably to use two other pointers to simulate the other arrays as seperate, or just use a special indexing scheme, so it can all be initialized once, instead of thrice. The algorithm is save from overflow, im sure, but is it okay?

thats all, thnx
{2}rIng

Comments

  • shaolin007shaolin007 Posts: 1,018Member
    : I'm back, after so long...
    :
    : but nvmd about that, this is my question
    :
    : I've making a recursive algorithm, but have failed to find an alternative to using dynamic arrays in it, for each call requires a variable length array. Can this slip through, just this once?
    :
    : Secondly, another horror is that each array needs to be initialized, one sneaky trick I thought of is to rather use a large single array instead of three (which each call has), and probably to use two other pointers to simulate the other arrays as seperate, or just use a special indexing scheme, so it can all be initialized once, instead of thrice. The algorithm is save from overflow, im sure, but is it okay?
    :
    : thats all, thnx
    : {2}rIng
    :
    [green]
    Post that portion of your code and lets see.
    [/green]

Sign In or Register to comment.