Tree : https://media.geeksforgeeks.org/wp-content/cdn-uploads/TreeToList.png
first we go left found null and made 25 as head, then we checked left and right of 25 but it’s NULL, so we returned to 12 and made boubly connection with 25.
Q1 : Am i right till now ?
Then we go to the right of 12 which is 30. we check left which is NULL, then we execute this steps;
if (prev == NULL)
*head = root;
else
{
root->left = prev;
prev->right = root;
}
prev = root;
// Finally convert right subtree
BinaryTree2DoubleLinkedList(root->right, head);
Q2 : what happens after , how 30 will connect to 12, i tried but i am not able to understand.