wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HEAPS

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

It is a specialized tree-based data structure that satisfies the ____ property.

a)

Priority Queues

b)

Maps

c)

Heaps

d)

Sets

2.

The key of a parent node is greater than or equal to the key of any of its children.

(a)  

3.

The key of a parent node is less than or equal to the key of any of its children.

(a)  

4.

What type of heap is this?

a)

Max Heap

b)

Min Heap

5.


What type of heap is this?

a)

Max Heap

b)

Min Heap

6.

In a Min Heap, every parent node is smaller than or equal to its (a)   .

7.

This function converts a regular list to a heap.

a)

heapify()

b)

tuple()

c)

list()

d)

dict()

8.

In a Max Heap, every parent node is ____ than or equal to its children.

a)

Less

b)

Greater

9.

To create a heap with initial values, use the ____ method of the Collections class.

a)

createHeap()

b)

initializeHeap()

c)

addAll()

d)

makeAll()

10.

How do you determine the root node's value?

a)

get()

b)

peek()

c)

insert()

d)

traverse()