2 2 votes A. Total no. of trees that were there in the forest. B. Total no. of nodes in the forest. C. Total no. of nodes which have only right child. D. Return max element among all nodes. Programming in C data-structures binary-tree + – Vaishnavi01 1.5k views answer comment Share Follow Print See all 8 Comments 8 8 Comments reply Magma commented Sep 28, 2018 reply Follow flag I think C) is the correct answer 0 0 replyShare Shaik Masthan commented Sep 28, 2018 reply Follow flag C should be wrong answer. But in the question, if they mentioned " it is arbitrary tree represented by right child pointers ", then option A is correct. I hope this question from ACE. 0 0 replyShare Magma commented Sep 28, 2018 reply Follow flag Shaik Masthan can you explain me ?? 0 0 replyShare Shaik Masthan commented Sep 28, 2018 reply Follow flag just take the Binary tree, root is A, left of root is B and right of root is C left of B is D and right of D is E, and E right is F, F right child is G, G right child is H right of C is J What is the answer by you? ( as you said it is 5 due to D have only right child, E have only right child,F have only right child, G have only right child, and C have only right child, ) If you apply the algorithm, what is Answer? only 3. 1 1 replyShare Magma commented Sep 28, 2018 reply Follow flag but why it's traverse the right child only ??? 0 0 replyShare Shaik Masthan commented Sep 28, 2018 reply Follow flag but why it's traverse the right child only ??? it is algorithm, you can have your own algorithm 0 0 replyShare Magma commented Sep 28, 2018 reply Follow flag Question is really good .but if this question come in gate I definitely tick option C but tell me one thing it's also hold .option C right ??? 0 0 replyShare Shaik Masthan commented Sep 28, 2018 reply Follow flag i already gave one example, why option C is wrong. 0 0 replyShare Please log in or register to add a comment.
2 2 votes According to the given algorithm it just calculates total no of right child of right sub tree only which doesnt matches with any of the options given. Priyanka17 answered Sep 28, 2018 Priyanka17 comment Share Follow See 1 comment 1 1 comment reply rish1602 commented Jul 19, 2021 reply Follow flag exactly… the number of right nodes of right sub tree. NONE of the option matches 0 0 replyShare Please log in or register to add a comment.