Binary tree (( build tree from pre order and post order ))

sir why was pointer ( i ) static variable??
why dont we make two nested loops instead of declaring
( i ) as a static variable?!!

hello @mzk1994

life time of static variable is lifetime of the program so it wont get reinitialised again n again after every new function call…

sry i dint get this pls explain a bit more,
if u dont want to use static variable then simply declare it as global variable

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.