Time Left - 15:00 mins

GATE 2022: Data Structure and Programming Quiz-8

Attempt now to get your rank among 313 students!

Question 1

Consider the following elements in a heap {17, 9, 6, 3, 12, 2, 15, 14, 20, 13, 21}. The minimum number of exchanges to convert it into a minheap is

Question 2

For the given nodes:

89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100

Minimum _____ number of interchanges are needed to convert it into a max-heap.

Question 3

Which one of the following array represents a binary max-heap?

Question 4

Find the number of min heap trees are possible with 7 elements such that every leaf node must be greater than all non-leaf nodes of the tree.

Question 5

Consider the following elements :

5, 12, 3, 15, 4, 6, 10

These elements are inserted into max heap tree using two different methods. In method 1, elements are inserted one by one into heap and heap property is maintained at every step. In method 2, first these elements are stored into an almost complete binary tree and then max-heapify function is executed on it. Now find the number of elements that has different index position into two heaps generated from given two methods _________.

Question 6

Consider a max heap. A heap is an almost complete binary tree and a max heap is almost complete binary tree with parent node greater than its children nodes. Consider the following keys are first inserted into an almost complete binary tree and then max heapify function is executed on it to convert it into max heap.

30, 16, 18, 35, 50, 10, 20, 23, 15

Find the number of swaps done to convert the almost complete binary tree into max heap _________.

• 313 attempts
• 0 upvotes
• 3 comments
Jul 29GATE & PSU CS

Posted by:

Member since Sep 2020
Priya Upadhyay
Share this quiz   |
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com