Looking for variant approach/sketch

Remember that iterative uses less stack space which in real projects is often more important than the performance gain.

when stack and heap meet, they "exchange" information ...