CPP - Binary Tree - Build Tree from PreOrder and Postorder

why are u using static int ?

@17manishms We are using static int as we want only one copy of that variable…and we do not want to intialize that variable for each function call…
All changes to that variable are made to that specific copy only…
If you do not use static…another option would be to initialize it globally.

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.