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?

DAY-4 DSA BOOTCAMP HEAP

Quiz
•
Computers
•
University
•
Hard
ATHARVA GALNE
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
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
Similar Resources on Quizizz
7 questions
DSA Day 4

Quiz
•
University
9 questions
DSA Day 3

Quiz
•
University
8 questions
DSA Group 2 (Heaps Quiz)

Quiz
•
University
10 questions
C Program Array and strings

Quiz
•
University
9 questions
DSC UNIT 7

Quiz
•
University
15 questions
Жанар214

Quiz
•
9th Grade - University
15 questions
[Python For All] Quiz 5 - Numpy

Quiz
•
University
10 questions
27Mar

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade