Priority Queues and Heaps

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Used 114+ times
FREE Resource
10 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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
AS Computing: Data Structures

Quiz
•
10th Grade - University
9 questions
Asesmen BK - Tree Graph 9

Quiz
•
9th Grade
10 questions
Heap Sort in Java

Quiz
•
12th Grade
8 questions
PRE TEST STRUKTUR DATA

Quiz
•
9th Grade
15 questions
Uji Pemahaman Komputasional

Quiz
•
9th Grade
13 questions
Graph Traversal Algorithms Quiz

Quiz
•
12th Grade - University
11 questions
1.3 - Network Topologies

Quiz
•
8th - 10th Grade
15 questions
FUNDAMENTALS OF ALGORITHMS - UNIT 3 MCQS

Quiz
•
12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
24 questions
Scientific method and variables review

Quiz
•
9th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
19 questions
Mental Health Vocabulary Pre-test

Quiz
•
9th Grade