
Floyd-Warshall Algorithm Quiz

Quiz
•
Computers
•
University
•
Easy
DURAI S
Used 2+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the Floyd-Warshall algorithm used for?
Finding the shortest path in an unweighted graph
Finding the shortest paths between all pairs of vertices in a weighted graph
Finding the Minimum Spanning Tree of a graph
Detecting cycles in a directed graph
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the time complexity of the Floyd-Warshall algorithm for a graph with V vertices?
O(V)
O(VlogV)
O(V^2)
O(V^3)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Floyd-Warshall algorithm is based on which programming paradigm?
Greedy Algorithm
Divide and Conquer
Dynamic Programming
Backtracking
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following graph representations is most suitable for the Floyd-Warshall algorithm?
Adjacency List
Adjacency Matrix
Edge List
Incidence Matrix
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main idea behind the Floyd-Warshall algorithm?
It uses a priority queue to determine the shortest path
It iteratively updates the shortest paths using an intermediate vertex
It builds a spanning tree using the minimum edge weight
It performs a depth-first search for shortest paths
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the Floyd-Warshall algorithm, if there is no edge between two vertices u and v, what should be their initial distance in the adjacency matrix?
0
1
∞ (Infinity)
-1
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If a graph has V vertices, how many times does the innermost loop of the Floyd-Warshall algorithm execute?
O(V)
O(V^2)
O(V^3)
O(V^4)
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following algorithms can be used as an alternative to Floyd-Warshall for finding all-pairs shortest paths?
Dijkstra’s Algorithm
Kruskal’s Algorithm
Prim’s Algorithm
Bellman-Ford Algorithm
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which property of the shortest path does the Floyd-Warshall algorithm exploit?
Greedy choice property
Optimal substructure
Backtracking property
Divide and conquer
Similar Resources on Wayground
10 questions
Graph

Quiz
•
University
10 questions
ADA Module-3 Quiz 2025

Quiz
•
University
14 questions
A-Level Computer Science Data Structures Quiz

Quiz
•
12th Grade - University
12 questions
Greedy Method

Quiz
•
University
10 questions
Operating Systems

Quiz
•
University
5 questions
Algorithm analysis: Dynamic Programming

Quiz
•
University
13 questions
Graph Traversal Algorithms Quiz

Quiz
•
12th Grade - University
6 questions
MPS INTERNAL 2 TEST

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade