
Exploring Trees and Graphs Quiz

Quiz
•
Computers
•
12th Grade
•
Medium
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
Similar Resources on Wayground
10 questions
AP Computer Science Principles - Unit 6: Algorithms

Quiz
•
9th - 12th Grade
10 questions
Search Algorithms

Quiz
•
9th - 12th Grade
10 questions
Asas Sains Komputer T3 : BAB 3: Pembangunan Algoritma

Quiz
•
12th Grade
9 questions
C++ Quiz 5: Searching and Sorting Algorithms

Quiz
•
7th - 12th Grade
15 questions
UTS INFORMATIKA PILIHAN GANDA SEMESTER 1

Quiz
•
9th - 12th Grade
14 questions
7.5 Search Algorithms

Quiz
•
12th Grade
12 questions
Binary Hex Decimal

Quiz
•
7th - 12th Grade
15 questions
Binary Addition

Quiz
•
9th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade