A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is
Which of the following sequences denotes the post order traversal sequence of the tree of above question?
1 Crore+ students have signed up on EduRev. Have you? Download the App |
In the balanced binary tree in the figure given below, how many nodes will become unbalanced when a node is inserted as a child of the node "g”?
A binary search tree is generated by inserting in order of the following integers: 50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24. The number of nodes in the left subtree and right subtree of the root respectively is
A binary search tree contains the values 1,2,3, 4, 5, 6, 7, 8. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output?
A complete n-ary tree is one in which every node has 0 or n sons. If x is the number of internal nodes of a complete n-ary tree, the number of leaves in it is given by
Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right subtrees, respectively, of node X. Note that Y and Z may be NULL, or further nested. Which of the following represents a valid binary tree?
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal. Respectively, of a complete binary tree. Which of the following is always true?
The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is
63 videos|8 docs|165 tests
|
63 videos|8 docs|165 tests
|