MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Initially the keys like M, S, G, H, B, V, W, T are inserted into Binary Search Tree. It has been checked and madeto an AVL tree. The CORRECT option is
A
S forms the leaf node
B
S forms the root node
C
S has two children
D
S has only Right child T
Explanation: 

Detailed explanation-1: -Explanation: Both the B-tree and the AVL tree have O(log n) as worst case time complexity for insertion and deletion.

Detailed explanation-2: -Balance factor of a node in an AVL tree is the difference between the height of the left subtree and that of the right subtree of that node. The self balancing property of an avl tree is maintained by the balance factor. The value of balance factor should always be-1, 0 or +1.

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. This difference is called the Balance Factor i.e. 0, 1, and-1.

There is 1 question to complete.