Quiz – 1

Question 1

Time: 00:00:00
 In a max-heap, element with the greatest key is always in the which node?

Leaf node

Leaf node

First node of left sub tree

First node of left sub tree

root node

root node

First node of right sub tree

First node of right sub tree

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 2

Time: 00:00:00
Heap exhibits the property of a binary tree?

True

True

False

False

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
What is the complexity of adding an element to the heap.

O(log n)

O(log n)

O(h)

O(h)

O(log n) & O(h)

O(log n) & O(h)

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00
The worst case complexity of deleting any arbitrary node value element from heap is

O(logn)

O(logn)

O(n)

O(n)

O(nlogn)

O(nlogn)

O(n2)

O(n2)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
 Heap can be used as ________________

Priority queue

Priority queue

Stack

Stack

A decreasing order array

A decreasing order array

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
data-structure-questions-answers-heap-q6

If we implement heap as min-heap , deleting root node (value 1)from the heap. What would be the value of root node after second iteration if leaf node (value 100) is chosen to replace the root at start.

2

2

100

100

17

17

3

3

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
data-structure-questions-answers-heap-q7

If we implement heap as maximum heap , adding a new node of value 15 to the left most node of right subtree . What value will be at leaf nodes of the right subtree of the heap.

15 and 1

15 and 1

25 and 1

25 and 1

3 and 1

3 and 1

2 and 3

2 and 3

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
An array consist of n elements. We want to create a heap using the elements. The time complexity of building a heap will be in order of

O(n*n*logn)

O(n*n*logn)

O(n*logn)

O(n*logn)

O(n*n)

O(n*n)

O(n *logn *logn)

O(n *logn *logn)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00
 On which algorithm is heap sort based on?

Fibonacci heap

Fibonacci heap

Binary tree

Binary tree

Priority queue

Priority queue

FIFO

FIFO

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00
 In what position does the array for heap sort contains data?

0

0

1

1

-1

-1

anywhere in the array

anywhere in the array

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Comments