wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ECS 36C Quizizz

Total questions: 29

Worksheet time: 6mins

Name
Class
Date
1.

Which of these is a divide and conquer algorithm?

a)

Merge Sort  

b)

Insertion Sort

c)

Bubble Sort

d)

Selection Sort

2.

What algorithm is used to find the shortest path in a graph?

a)

Linear Search

b)

Binary Search

c)

Dijkstra's  

d)

Depth First Search

3.

What data structure uses LIFO?

a)

Linked List

b)

Stack  

c)

Queue

d)

Array

4.

What is the worst case time complexity of a linear search?

a)

O(log n)

b)

O(1)

c)

O(n^2)

d)

O(n)  

5.

In its most basic form, what does a node in a Linked List consist of?

a)

Data

b)

One area for data, and one area with a pointer to the next node in the list  

c)

Pointers to the head and tail of the Linked List

d)

An adjacency matrix

6.

What makes a tree 'binary'?

a)

Each node has two parent nodes

b)

Each edge is bi-directional

c)

Each node can have at most two child nodes  

d)

The tree has two root nodes

7.

What is the tree height?

a)

The maximum number of edges between the root node and a leaf node  

b)

The number of internal nodes

c)

The number of leaf nodes

d)

The total number of edges in the tree

8.

Does a Linked List have a fixed size in memory?

a)

Yes

b)

No

9.

Which data structure uses FIFO?

a)

Array

b)

Queue

c)

Stack

d)

Linked List

10.

Which data structure allows us to access any element directly?

a)

Stack

b)

Queue

c)

Linked List

d)

Array  

11.

What is the worst-case time complexity of Bubble Sort?

a)

O(n log n)

b)

O(n^2)  

c)

O(logn)

d)

O(n)

12.

What kind of graph does Dijkstra's Algorithm not work with?

a)

Directed

b)

Undirected

c)

Graphs with negative weights  

d)

Weighted

13.

Which of these algorithms are usually implemented using recursion?

a)


Merge sort  

b)

Bubble sort

c)

Radix sort

d)

Selection sort

14.

What is recursion in programming?

a)


A function that calls itself  

b)

When the shortest path cannot be found

c)

A syntax error

d)

Going in negative cycles

15.

If an AVL tree has '2' as the balance factor (rhs-lhs), what kind of rotation is done to self-balance?

a)

Down

b)

Up

c)

Right

d)

Left

16.

What is good about using arrays in algorithms?

a)

No shifting operations in memory needed when array elements are deleted or inserted

b)

In memory, an array element does not have to come right after the previous element

c)

Memory usage is dynamic: memory usage is automatically adjusted by the number of elements in the array

d)

Array elements can be accessed directly  

17.

Level of a node is distance from root to that node. For example, level of root is 1 and levels of left and right children of root is 2. The maximum number of nodes on level i of a binary tree is

In the following answers, the operator '^' indicates power.

a)

2^i

b)

2^(i-1)

c)

2^(i+1)

d)

2^[(i+1)/2]

18.

The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is:

a)

2^h -1

b)

2^(h-1) – 1

c)

2^(h+1) -1

d)

2*(h+1)

19.

The elements 32, 15, 20, 30, 12, 25, 16 are inserted one by one in the given order into a Max Heap. The resultant Max Heap is. 

a)

a

b)

b

c)

c

d)

d

20.

Consider any array representation of an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (i <= n), the index of the parent is

a)

i-1

b)

floor(i/2)

c)

ceil(i/2)

d)

(i+2)/2

21.

Given a binary-max heap. The elements are stored in an arrays as 25, 14, 16, 13, 10, 8, 12. What is the content of the array after two delete operations?

a)

14,13,8,12,10

b)

14,12,13,10,8

c)

14,13,12,8,10

d)

14,13,12,10,8

22.

How is a value searched for in a Binary Search Tree? (fill-in-the-blank)

(a)  

23.

If we are deleting node 13, which node will replace 13 (or the in-order successor of 13)?

a)

14

b)

19

c)

18

d)

DNE

24.

Because the adjacency matrix is symmetric, what do we know about the graph?

(a)  

25.

What is the next vertex to be visited after C is visited?

a)

A

b)

B

c)

F

d)

G

26.

In Union-Find Cycle Detection, how is a cycle detected?

a)

When a new union if found

b)

When two vertices belong to diffent unions

c)

When there is a higher number of negative vertices than positive ones

d)


When two vertices already belong to the same union  

27.

Radix sort must use a ______ algorithm to sort the values correctly.

a)

in-place

b)

stable

c)

cubic

d)

online

28.

What is the post-order traversal of this tree?

(a)  

29.

This is a picture of:
(note: 6 is the left child of 3)

a)

Full Tree

b)

Complete Tree

c)

Balanced Binary Tree

d)

Graph