Can you convert a binary tree into a doubly linked list?
Yes, you can simply do in-order traversal on the binary tree and store the value of the previous node for every node visited. Then, for every visited node, make this the next of the previous node and set the value of its previous node as previous. For this, first, you have to create a binary tree node that has data, left pointers and right pointers. Create a pointer to the head node of the doubly linked list and Initialize the previously visited node as NULL. This value is kept static so that the same value can be visited for all recursive calls. Then you create a simple recursive function to convert a given Binary tree to a Doubly Linked List.