Computer Science, asked by itsgourab92, 10 months ago

write a program in java convert binary tree to DLL​

Answers

Answered by Anonymous
3

Explanation:

Perform inorder traversal of the binary tree by converting the left subtree first.

...

display() will show all the nodes present in the list.

Define a new node 'current' that will point to the head.

Print current. data till current points to null.

Current will point to the next node in the list in each iteration.

Answered by kolhiv32
0

Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL) In-Place. The left and right pointers in nodes are to be used as previous and next pointers respectively in converted DLL. The order of nodes in DLL must be same as Inorder of the given Binary Tree. The first node of Inorder traversal (left most node in BT) must be head node of the DLL.

TreeToList

Similar questions