MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following best describes AVL tree?
A
A tree which is a binary search tree but unbalanced tree.
B
A tree which is binary search tree and height balanced tree.
C
A tree with utmost two children
D
A tree with utmost three children
Explanation: 

Detailed explanation-1: -All AVL trees are binary search tree.

Detailed explanation-2: -A height-balanced binary tree is defined as a binary tree in which the height of the left and the right subtree of any node differ by not more than 1. AVL tree, red-black tree are examples of height-balanced trees.

Detailed explanation-3: -AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than 1 for all nodes.

Detailed explanation-4: -AVL Tree can be defined as height balanced binary search tree in which each node is associated with a balance factor which is calculated by subtracting the height of its right sub-tree from that of its left sub-tree.

Detailed explanation-5: -In the AVL tree, each node contains a balance factor, and the value of the balance factor must be either-1, 0, or 1. Every Binary Search tree is not an AVL tree because BST could be either a balanced or an unbalanced tree. Every AVL tree is a binary search tree because the AVL tree follows the property of the BST.

There is 1 question to complete.