
Graph Quiz
Quiz
•
Information Technology (IT)
•
University
•
Practice Problem
•
Medium
Chong May
Used 73+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is used to represent a graph efficiently when the graph is sparse?
Adjacency Matrix
Adjacency List
Edge List
Incidence Matrix
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which traversal technique uses a queue?
DFS
BFS
Dijkstra’s
Kruskal’s
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these algorithms is used to find the shortest path from a single source to all vertices?
Prim’s
Kruskal’s
Dijkstra’s
DFS
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What data structure is used in DFS?
Queue
Stack
Heap
Priority Queue
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which algorithm is used for topological sorting?
BFS
DFS
Kruskal
Either BFS or DFS
Answer explanation
Topological sorting is applicable only to Directed Acyclic Graphs (DAGs), and both DFS and BFS can be used to perform it, but with different approaches.
🔹 1. Using DFS (Depth-First Search):
This is the most common method.
Perform DFS traversal and push each node onto a stack after visiting all its neighbors.
Once all nodes are visited, pop from the stack to get the topological order.
2. Using BFS (Kahn’s Algorithm):BFS-based method using in-degrees of nodes.
Start with nodes having in-degree = 0, and repeatedly remove them while updating in-degrees of neighbors.
Works well for cycle detection too (if not all nodes are sorted, a cycle exists).
✅ Steps:
Calculate in-degrees.
Enqueue all nodes with in-degree 0.
While queue is not empty:
Dequeue node and add it to result.
Decrease in-degree of its neighbors.
If in-degree of neighbor becomes 0, enqueue it.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main difference between Kruskal’s and Prim’s algorithm?
Prim’s uses greedy approach, Kruskal doesn’t
Kruskal works on connected graphs only
Kruskal selects edges globally, Prim’s grows from a node
Prim’s is slower than Kruskal
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following best describes the output of a topological sort?
All edges in minimum weight
Nodes in a linear order with all dependencies resolved
Shortest paths from a single node
All cycles in a graph
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
27 questions
Ujian Koding & KA
Quiz
•
10th Grade - University
29 questions
Ôn tập tin 7 giữa kì 1
Quiz
•
7th Grade - University
25 questions
STS INFORMATIKA *
Quiz
•
8th Grade - University
25 questions
Seatwork #4
Quiz
•
12th Grade - University
25 questions
Quiz Jaringan Komputer
Quiz
•
7th Grade - University
25 questions
soal uh 9
Quiz
•
9th Grade - University
25 questions
Assesment 1
Quiz
•
University
25 questions
midterm Quiz1 on Human-Computer Interaction
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Information Technology (IT)
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
5 questions
Helping Build the Internet: Valerie Thomas | Great Minds
Interactive video
•
11th Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
19 questions
Review2-TEACHER
Quiz
•
University
15 questions
Pre2_STUDENT
Quiz
•
University
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University
