Exploring Trees and Graphs Quiz

Exploring Trees and Graphs Quiz

12th Grade

10 Qs

quiz-placeholder

Similar activities

SLR5 | Algorithms

SLR5 | Algorithms

12th Grade

15 Qs

Search Algorithms

Search Algorithms

9th - 12th Grade

10 Qs

Linear and Binary Search Quiz

Linear and Binary Search Quiz

12th Grade

15 Qs

Understanding Linear Search Algorithm

Understanding Linear Search Algorithm

12th Grade

11 Qs

CSF U2 Algorithms p1

CSF U2 Algorithms p1

9th - 12th Grade

10 Qs

Algorithms

Algorithms

9th - 12th Grade

10 Qs

Java Arrays Basic

Java Arrays Basic

10th - 12th Grade

15 Qs

Data Structures & Algorithms

Data Structures & Algorithms

12th Grade

10 Qs

Exploring Trees and Graphs Quiz

Exploring Trees and Graphs Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

S Uwadiae

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the height of a binary tree with 15 nodes in the best-case scenario?

3

4

5

6

Answer explanation

In a balanced binary tree, the height is minimized. For 15 nodes, the best-case height is 4, as a complete binary tree with 15 nodes has 4 levels (2^4 - 1 = 15). Thus, the correct answer is 4.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a characteristic of a complete binary tree?

All levels are completely filled except possibly the last, which is filled from left to right.

All nodes have two children.

All leaf nodes are at the same level.

It is a binary search tree.

Answer explanation

A complete binary tree is defined by having all levels fully filled except possibly the last, which must be filled from left to right. This distinguishes it from other types of binary trees, making the first choice correct.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a graph, what is the term used to describe a path that starts and ends at the same vertex without repeating any edges?

Cycle

Circuit

Loop

Walk

Answer explanation

A circuit is a path in a graph that starts and ends at the same vertex without repeating any edges. While a cycle also starts and ends at the same vertex, it can repeat vertices, making 'circuit' the correct term for this definition.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data structure is used to implement a breadth-first search (BFS) on a graph?

Stack

Queue

Priority Queue

Linked List

Answer explanation

A breadth-first search (BFS) uses a queue to explore nodes level by level. Nodes are enqueued as they are discovered and dequeued for exploration, ensuring that all nodes at the current depth are processed before moving deeper.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of searching for an element in a balanced binary search tree (BST)?

Answer explanation

In a balanced binary search tree (BST), the height is logarithmic relative to the number of nodes, allowing search operations to be performed in O(log n) time. This makes O(log n) the correct choice for search time complexity.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true for a tree data structure?

It can have cycles.

It is a type of graph.

It must be a binary tree.

It has no root node.

Answer explanation

A tree is a type of graph characterized by its acyclic nature and hierarchical structure. It does not have cycles, can have various forms (not just binary), and must have a root node.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a directed graph, what is the term for a vertex with no incoming edges?

Sink

Source

Isolated

Terminal

Answer explanation

In a directed graph, a vertex with no incoming edges is called a 'Source'. It can send edges to other vertices but does not receive any. A 'Sink' is the opposite, having no outgoing edges.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?