Answer to Question #314881 in Functional Programming for Akash srivastava

Question #314881

Binary tree to double linked list

Problem Statement

Given a Binary Tree, your task is to convert it to a Doubly Linked List. The left and right pointers in nodes are to be used as previous and next pointers respectively in converted Double linked list. The order of nodes in Double linked list must be same as Inorder of the given Binary Tree. The first node of Inorder traversal (left most node in Binary tree) must be head node of the Doubly linked list.

Input

User Task:

Since this will be a functional problem. You don't have to take input. You just have to complete the function BToDLL() that takes "root" node of binary tree as parameter.


Constraint:-

1 <= Number of Nodes <= 1000

1 <= Node.data <= 1000

Output

The printing is done by the driver code you just need to complete the function.



0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS