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.

Start

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.

Start

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.

Start

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.

Start

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.

Start

Question 6

Time: 00:00:00
```

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.

Start

Question 7

Time: 00:00:00
```

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.

Start

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.

Start

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.

Start

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.

Start

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

Completed

0/0

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

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.

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.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects