Floyd-Warshall Algorithm Quiz

Floyd-Warshall Algorithm Quiz

University

9 Qs

quiz-placeholder

Similar activities

Basics of Computers

Basics of Computers

University

10 Qs

Traveling Salesman Quiz - Batch 1

Traveling Salesman Quiz - Batch 1

University

14 Qs

Advanced DataStructures

Advanced DataStructures

University

10 Qs

Graph Algorithms Quiz

Graph Algorithms Quiz

University

14 Qs

Quiz 3 OS Jun 2019

Quiz 3 OS Jun 2019

University

10 Qs

DSA Quiz 4 Set 1

DSA Quiz 4 Set 1

University

10 Qs

02 - Graph Algorithm

02 - Graph Algorithm

University

12 Qs

Analysis of Algorithms Quiz

Analysis of Algorithms Quiz

University

10 Qs

Floyd-Warshall Algorithm Quiz

Floyd-Warshall Algorithm Quiz

Assessment

Quiz

Computers

University

Easy

Created by

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