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
Business Studies,
8 months ago
Science,
8 months ago
Physics,
8 months ago
English,
1 year ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago