Open In App

GATE | GATE CS 1999 | Question 60

[5 Marks question]
a. In a binary tree, a nil node is defined to be a node with 2 children. Use induction on the height of the binary tree to prove that the number of full nodes plus one is equal to the number of leaves.

b. Draw a min-heap that results from insertion of the following elements in order into an initially empty min-heap: 7, 6, 5, 4, 2, 3, 1. Show the result after the deletion of the root of this heap.

Answer:
Explanation:
Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :