McqMate

Q. |
## Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without performing any rotations? |

A. | just build the tree with the given input |

B. | find the median of the set of elements given, make it as root and construct the tree |

C. | use trial and error |

D. | use dynamic programming to build the tree |

Answer» B. find the median of the set of elements given, make it as root and construct the tree |

1.1k

0

Do you find this helpful?

2

View all MCQs in

Data Structures (DS)No comments yet

- An AVL tree is a self – balancing binary search tree, in which the heights of the two child sub trees of any node differ by
- What is an AVL tree?
- What is the maximum height of an AVL tree with p nodes?
- What maximum difference in heights between the leafs of a AVL tree is possible?
- A binary tree in which all its levels except the last, have maximum numbers of nodes, and all the nodes in the last level have only one child it will be its left child. Name the tree.
- Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of the same binary tree is B, E, A, D, C. The level order sequence for the binary tree is
- When converting binary tree into extended binary tree, all the original nodes in binary tree are___________.
- In a directed tree if the ordering of the nodes at each level is prescribed then such a tree is called_______ tree.
- In a binary search tree, which of the following traversals would print the numbers in the ascending order?
- Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are: i. isEmpty (Q) — returns true if the queue is empty, false otherwise. ii. delete (Q) — deletes the element at the front of the queue and returns its value. iii. insert (Q, i) — inserts the integer i at the rear of the queue. Consider the following function: void f (queue Q) { int i ; if (!isEmpty(Q)) { i = delete(Q); f(Q); insert(Q, i); } }What operation is performed by the above function f ?