Why cant we solve this using inorder traversal and hence connecting the nodes to each other?

Why cant we solve this using inorder traversal and hence connecting the nodes to each other?

hello @garganshul151
u can do that as well.

but in the video sir has denied that…why?

@garganshul151
ok let me tell u the approach,
first do a inorder traversal and store all the data into vector. (inorder will give u sorted order)
now u can use this vector and prepare a linklist .

But why sir has denied this approach in the video?

we are using extra space in above approach,bhiaya might be trying to do it without using extra space.

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.