A balanced tree is given below. How many nodes will become unbalanced when a node is inserted as a child of node G?
Note: A node in a tree is balanced if absolute difference between its left and right subtrees is less than or equal to 1.
(A) 2
(B) 3
(C) 4
(D) 5
Answer: (B)
Explanation: Let node x is inserted.
In this structure, Node (C) (B) and (A) not having difference between left subtree and right subtree -1, 0, 1. Therefore 3 nodes become unbalanced.
Quiz of this Question
Recommended Posts:
- GATE | GATE MOCK 2017 | Question 1
- GATE | GATE MOCK 2017 | Question 2
- GATE | GATE MOCK 2017 | Question 3
- GATE | GATE MOCK 2017 | Question 4
- GATE | GATE MOCK 2017 | Question 5
- GATE | GATE MOCK 2017 | Question 6
- GATE | GATE MOCK 2017 | Question 7
- GATE | GATE MOCK 2017 | Question 8
- GATE | GATE MOCK 2017 | Question 9
- GATE | GATE MOCK 2017 | Question 10
- GATE | GATE MOCK 2017 | Question 11
- GATE | GATE MOCK 2017 | Question 12
- GATE | GATE MOCK 2017 | Question 13
- GATE | GATE MOCK 2017 | Question 14
- GATE | GATE MOCK 2017 | Question 15
- GATE | GATE MOCK 2017 | Question 16
- GATE | GATE MOCK 2017 | Question 17
- GATE | GATE MOCK 2017 | Question 18
- GATE | GATE MOCK 2017 | Question 19
- GATE | GATE MOCK 2017 | Question 20



