Call Support +91-85588-96644
TCYonline

Login

Sign Up

Please enter a Username or Email ID
Please enter a password
Keep me logged in
Please enter your name
Please enter your mobile number
You can't leave Captcha Code empty
By submitting this form, you agree to the Terms & Privacy Policy.
OR

Sign Up via Facebook

Sign Up via Google

Sign Up via Twitter

Download Software
Tests given

Download TCY App

App Image

The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudocode below is invoked as height (root) to compute the height of a binary tree rooted at the tree pointer root.
int height (treeptr n)

The appropriate expressions for the two boxes B1 and B2 are

 
B1: (1 + height (nright))
B2: (1 - max (h1, h2))
B1: (height (nright))
B2: (1 - max (h1, h2))
B1: height (nright)
B2: max (h1, h2)
B1: (1 + height (nright))
B2: max (h1, h2)

Reply


Please type your answer before submitting.
Submit

Yes, 1 needs to be added, But Option A is anyways wrong since it says 1 - max(h1, h2). Why SUBSTRACTION IN OPTION 1?????