Binary tree to dll

some error in code TLE error

there are two issues in your code :-

  1. initialize your head and prev with NULL
  2. pass head and prev by reference since you are changing the values of head and prev that you want to persist after the function ends

i have corrected your code :- https://ide.codingblocks.com/s/241922

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.