DAY-4 DSA BOOTCAMP HEAP

DAY-4 DSA BOOTCAMP HEAP

University

10 Qs

quiz-placeholder

Similar activities

Circular array quiz

Circular array quiz

University

10 Qs

Ms Excel Functions

Ms Excel Functions

University

10 Qs

DSA Day 3

DSA Day 3

University

9 Qs

DAA Quiz on Sorting

DAA Quiz on Sorting

University

8 Qs

LR

LR

University

6 Qs

DSA Group 2 (Heaps Quiz)

DSA Group 2 (Heaps Quiz)

University

8 Qs

DSA Day 4

DSA Day 4

University

7 Qs

Heap Sorting

Heap Sorting

University

10 Qs

DAY-4 DSA BOOTCAMP HEAP

DAY-4 DSA BOOTCAMP HEAP

Assessment

Quiz

Computers

University

Hard

Created by

ATHARVA GALNE

Used 1+ times

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Given two max heaps of size n each, what is the minimum possible time complexity to make a one max-heap of size from elements of two max heaps?

O(n^2)

O(nLogLogn)

O(n)

O(nLogn)

Answer explanation

We can build a heap of 2n elements in O(n) time. Following are the steps. Create an array of size 2n and copy elements of both heaps to this array. Call build heap for the array of size 2n. Build heap operation takes O(n) time.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following Binary Min Heap operation has the highest time complexity?

Inserting an item under the assumption that the heap has capacity to accommodate one more item

Merging with another heap under the assumption that the heap has capacity to accommodate items of other heap

Deleting an item from heap

Decreasing value of a key

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4. Now consider that a value 35 is inserted into this heap. After insertion, the new heap is

40, 30, 20, 10, 15, 16, 17, 8, 4, 35

40, 35, 20, 10, 30, 16, 17, 8, 4, 15

40, 30, 20, 10, 35, 16, 17, 8, 4, 15

40, 35, 20, 10, 15, 16, 17, 8, 4, 30

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following array of elements. 〈89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100〉. The minimum number of interchanges needed to convert it into a max-heap is

4

3

5

2

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the time complexity of Build Heap operation? 
(Build Heap is used to build a max(or min) binary heap from a given array. Build Heap is used in Heap Sort as a first step for sorting.)

O(nLogn)

O(n^2)

O(n)

O(logn)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks like this: 16 14 15 10 12 27 28 How many heapify operations have been performed on root of heap?

1

2

3 or 4

5 or 6

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose the elements 7, 2, 10 and 4 are inserted, in that order, into the valid 3- ary max heap found in the above question, Which one of the following is the sequence of items in the array representing the resultant heap?

10, 7, 9, 8, 3, 1, 5, 2, 6, 4

10, 9, 8, 7, 6, 5, 4, 3, 2, 1

10, 9, 4, 5, 7, 6, 8, 2, 1, 3

10, 8, 6, 9, 7, 2, 3, 4, 1, 5

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?