tag:blogger.com,1999:blog-5111437799351011175.post1467012548954156770..comments2019-03-24T22:42:56.495+05:30Comments on BtechOnline.Org: GATE Questions-Data Structures-TreesVinodhttp://www.blogger.com/profile/13847570322107535660noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-5111437799351011175.post-21287962728713458672019-03-13T23:36:07.414+05:302019-03-13T23:36:07.414+05:30We have n distinct values stored in a binary searc...We have n distinct values stored in a binary search tree. Define the height of a tree to be the number of nodes in the longest path from root to leaf. Which of the following statements is not true?<br />1. The height of the tree is at least log n.<br /> 2.The height of the tree is at most n.<br />3. If the root is the median value, the height of the tree is at most log n.<br /> 4.If the root is the median value, the height of the tree is at most n/2.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-40913528684951287142017-01-14T12:32:50.183+05:302017-01-14T12:32:50.183+05:30Question
if((a==b) AND (c>b)) ? FALSE : ((a+10)...Question<br />if((a==b) AND (c>b)) ? FALSE : ((a+10)==c)<br />When a=10, b=15 and c=20 <br /><br />Answer : 1Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-3685809874806846392016-11-09T10:12:45.083+05:302016-11-09T10:12:45.083+05:30In q6 option c is not wrong as in the very next qu...In q6 option c is not wrong as in the very next question complete n ary tree has been een described as one having either 3 or 0 children by the same logic a complete binary tree should have 2 or 0 children only and hence c should be true.<br />Ayushinoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-84110761513139810352016-11-09T07:52:25.974+05:302016-11-09T07:52:25.974+05:30In q6 option c is not wrong as in the very next qu...In q6 option c is not wrong as in the very next question complete n ary tree has been een described as one having either 3 or 0 children by the same logic a complete binary tree should have 2 or 0 children only and hence c should be true.<br />Ayushinoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-78863768279659683152016-09-20T17:46:01.405+05:302016-09-20T17:46:01.405+05:30!!!!!!WilliamKinghttps://www.blogger.com/profile/11551278829221366384noreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-91528377715593825722015-12-27T17:32:46.453+05:302015-12-27T17:32:46.453+05:30Option C is also false. Please check the explanati...Option C is also false. Please check the explanation for question 6, we have provided an example of a complete binary tree for which the statement proves to be false. We have considered root node as internal node. BtechOnline.Orghttp://www.facebook.com/btechonlineorgnoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-39179087144994109652015-12-27T03:27:29.848+05:302015-12-27T03:27:29.848+05:30Option b is false as stated in the reason above. O...Option b is false as stated in the reason above. Option c is correct. If we take a complete binary tree with root node A having 2 children (B and C) out of which B has 2 children (D & E) and C has none, then we will see number of internal nodes here(A,B) is 2 and number of leaves(C,D,E) is 3. Root node is also considerd here as an internal node. :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-88809735008088316632015-02-03T12:45:41.930+05:302015-02-03T12:45:41.930+05:30:):)ramhttp://fb.comnoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-45669003601156752632015-01-20T21:41:08.575+05:302015-01-20T21:41:08.575+05:30yes..Q 6 is wrong.
A unique Bst can be created onl...yes..Q 6 is wrong.<br />A unique Bst can be created only for<br />a.inorder and level order.<br />b.inorder and postorder<br />c.inorder and preorder.<br />for preorder and postorder no unnique tree possible.<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-62469148768585970232014-12-21T09:06:51.856+05:302014-12-21T09:06:51.856+05:30b and c are falseb and c are falseSandeep Uniyalhttps://www.blogger.com/profile/03385908494046980212noreply@blogger.comtag:blogger.com,1999:blog-5111437799351011175.post-60896102684835279492014-01-06T13:45:57.033+05:302014-01-06T13:45:57.033+05:306. Which of the following statements is false?
(a...6. Which of the following statements is false? <br />(a) A tree with n nodes has (n – 1) edges <br />(b) A labeled rooted binary tree can be uniquely constructed given its postorder and preorder traversal results. <br />(c) A complete binary tree with n internal nodes has (n + 1) leaves. <br />(d) The maximum number of nodes in a binary tree of height h is (2h+1-1)<br /><br />In this question option b is also false...because we cannot construct a binary tree uniquely using preorder and post order..Correct me if iam wrong<br />Saneesh Mohammedhttps://www.blogger.com/profile/17673473971109228077noreply@blogger.com