
DAY-4 DSA BOOTCAMP HEAP
Quiz
•
Computers
•
University
•
Hard
ATHARVA GALNE
Used 1+ times
FREE Resource
Enhance your content
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple

Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
informatika
Quiz
•
7th Grade - University
10 questions
Evaluación final Programación estructurada
Quiz
•
University
10 questions
Analysis of Algorithms
Quiz
•
University
7 questions
Final Practice
Quiz
•
University
10 questions
DAA Quiz 1
Quiz
•
University
11 questions
Tutorium 1 - Prog2
Quiz
•
University
8 questions
Programování - opakování
Quiz
•
University
7 questions
Python Round 4
Quiz
•
University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
11 questions
NFL Football logos
Quiz
•
KG - Professional Dev...
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms
Quiz
•
11th Grade - University
38 questions
Unit 6 Key Terms
Quiz
•
11th Grade - University
20 questions
La Hora
Quiz
•
9th Grade - University
7 questions
Cell Transport
Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University