Practice Exam

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:29 AM on 5/1/24
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards

Bellman-Ford Algorithm

It can handle graphs with negative weight edges.

2
New cards

Bellman-Ford Algorithm

It only calculates paths up to the first negative cycle.

3
New cards

Bellman-Ford Algorithm

Time complexity is 𝑂(∣𝑉∣×∣𝐸∣).

4
New cards

Bellman-Ford Algorithm

When the graph contains negative weight edges and you need to verify the presence of negative weight cycles.

5
New cards

Bellman-Ford Algorithm

After how many iterations of edge relaxations does the Bellman-Ford algorithm conclude in a graph with 𝑛n vertices? Answer:𝑛−1n−1

6
New cards

Bellman-Ford Algorithm

The purpose of the additional iteration after the initial ∣𝑉∣−1 iterations is to check for negative weight cycles.

7
New cards

Bellman-Ford Algorithm

Space complexity is 𝑂(∣𝑉∣).

8
New cards

Dijkstra's Algorithm

Priority Queue is commonly used in the implementation for optimal efficiency.

9
New cards

Dijkstra's Algorithm

It cannot handle negative weight cycles.

10
New cards

Dijkstra's Algorithm

Time complexity using a binary heap (priority queue) is 𝑂((∣𝐸∣+∣𝑉∣)log⁡∣𝑉∣).

11
New cards

Dijkstra's Algorithm

Terminated when all of the above conditions are met.

12
New cards

Dijkstra's Algorithm

When you need to find the shortest path in a graph with non-negative edge weights.

13
New cards

Dijkstra's Algorithm

It effectively solves finding the shortest path from a single source to all other vertices.

14
New cards

Dijkstra's Algorithm

Ensures the shortest path to a vertex is found before moving on to the next vertex by always choosing the vertex with the smallest known distance from the source next.

15
New cards

Floyd-Warshall Algorithm

It primarily computes the shortest paths between every pair of vertices in a graph.

16
New cards

Floyd-Warshall Algorithm

It updates its estimates based on relaxation of edges like Dijkstra's algorithm.

17
New cards

Floyd-Warshall Algorithm

Time complexity is 𝑂(∣𝑉∣3).

18
New cards

Floyd-Warshall Algorithm

Typically implemented on an Adjacency matrix.

19
New cards

Floyd-Warshall Algorithm

The matrix dist[][] is initially filled out by setting dist[i][j] to the weight of the edge (i, j) if it exists, otherwise infinity.

20
New cards

Floyd-Warshall Algorithm

It can detect cycles by finding negative values on the diagonal of the distance matrix after completion.

21
New cards

Floyd-Warshall Algorithm

Ideal for using when you need the shortest paths between every pair of vertices in a dense graph.