Write a algorithm and program that accept any tree as input and convert it into binary tree
Answers
Answered by
1
(1) Call Mirror for left-subtree
i.e., Mirror(left-subtree)
(2) Call Mirror for right-subtree
i.e., Mirror(right-subtree)
(3) Swap left and right subtrees. temp = left-subtree left-subtree = right-subtree right-subtree = temp
i.e., Mirror(left-subtree)
(2) Call Mirror for right-subtree
i.e., Mirror(right-subtree)
(3) Swap left and right subtrees. temp = left-subtree left-subtree = right-subtree right-subtree = temp
Similar questions
Math,
7 months ago
Math,
7 months ago
Economy,
7 months ago
English,
1 year ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago