Priority Queues and Heapsort

Priority Queues and Heapsort

9th - 12th Grade

27 Qs

quiz-placeholder

Similar activities

Revision grade 11 term 3

Revision grade 11 term 3

11th Grade

23 Qs

Computer Pretest1(Arduino Grade8_t1)

Computer Pretest1(Arduino Grade8_t1)

3rd Grade - University

25 Qs

Functions in RobotC

Functions in RobotC

7th - 11th Grade

22 Qs

COMPTia

COMPTia

9th - 12th Grade

22 Qs

CodeHS Data AP CSP

CodeHS Data AP CSP

11th - 12th Grade

22 Qs

Navigating Digital Information: Review of all Ten Videos

Navigating Digital Information: Review of all Ten Videos

9th Grade - University

23 Qs

Quiz #4 Etech

Quiz #4 Etech

11th Grade

25 Qs

Spreadsheet(Advanced Mixed Quiz)

Spreadsheet(Advanced Mixed Quiz)

10th Grade

24 Qs

Priority Queues and Heapsort

Priority Queues and Heapsort

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Used 36+ times

FREE Resource

AI

Enhance your content in a minute

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

27 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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

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

Already have an account?