Priority Queues and Heapsort
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Used 36+ times
FREE Resource
Enhance your content in a minute
27 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following are min heaps?
A
B
C
D
2.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
The 2 properties of a min heap are _____.
Tree must be full.
Tree must be complete.
Node values are always smaller than their children's values.
Node values are always greater than their children's values.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many swaps are made in the min heap when inserting the value 18?
0
1
2
3
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the efficiency of adding to a priority queue using the java.util.PriorityQueue class?
O(n)
O(n log n)
O(1)
O(log n)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What operation has efficiency O(1) using the java.util.PriorityQueue class?
Add
Remove
Peek
6.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following PriorityQueue<E> methods will throw an exception when used on an empty queue?
E remove()
E peek()
E element()
E poll()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When removing the root from a min heap, what is the first step?
Replace the root with the next smallest value from the tree
Replace the root with the leaf furthest to the left on the bottom level of the tree
Replace the root with the leaf furthest to the right on the bottom level of the tree
Replace the root with the smallest of its children
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
24 questions
ETech Quiz reviewer week 1
Quiz
•
11th Grade
25 questions
CPA Inkscape Quiz 01
Quiz
•
7th - 12th Grade
27 questions
CDI - Electronic Components & Signals
Quiz
•
10th - 12th Grade
22 questions
1.02 Setting a PC System Vocabulary : Zack DeBenedictis
Quiz
•
9th - 12th Grade
25 questions
BTEC Creative Digital Media - Unit 01 - Test 02
Quiz
•
10th - 11th Grade
23 questions
9th L1 L2
Quiz
•
9th Grade
25 questions
ADMINISTRASI SISTEM JARINGAN - Penilaian Tengah Semester (Remidi dan Susulan)
Quiz
•
11th Grade
23 questions
Uji Pengetahuan Teknik Informatika
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
