Dijkstra's Shortest Path Algorithm (OCR A-Level Computer Science): Quizzes

📚Quizzes
Dijkstra's Shortest Path Algorithm
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

15 questions from this quiz

Show

What type of edge weights must a graph have for Dijkstra's algorithm to guarantee the shortest path?

Non-negative weights

What is the initial distance value set for the source node in Dijkstra's algorithm?

00

What is the initial distance value set for all non-source nodes in Dijkstra's algorithm?

Infinity (∞\infty)

What type of algorithm is Dijkstra's shortest path algorithm?

Greedy algorithm

What is the time complexity of Dijkstra's algorithm using an adjacency matrix?

O(V2)O(V^2)

What is the time complexity of Dijkstra's algorithm with a priority queue using a binary heap?

O((V+E)log⁡V)O((V + E) \log V)

What is the space complexity for Dijkstra's algorithm using an adjacency list?

O(V+E)O(V + E)

Which unvisited node should be selected next in Dijkstra's algorithm?

Node with smallest tentative distance

What happens to a node after all its neighbours are evaluated in Dijkstra's algorithm?

Marked as visited, not revisited

In the example, what is the shortest distance from A to B?

33 (via C)

In the example, what is the total distance of the shortest path from A to E?

77

In the tracing example, what is the distance from A to C?

33 (via B)

What is a common mistake when implementing Dijkstra's algorithm regarding initialisation?

Forgetting to set source distance to 00

What problem occurs if already visited nodes are revisited in Dijkstra's algorithm?

Incorrect or inefficient execution

In the tracing example, what is the final distance from A to E?

66 (via D)

Explore OCR A-Level Computer Science Revision Notes by Topics

Explore OCR A-Level Computer Science Model Answers by Topics

Explore OCR A-Level Computer Science Flashcards by Topics

Explore OCR A-Level Computer Science Exam Questions by Topics

Join 100,000+ A-Level students studying Quizzes with us.

Select your subjects, and get access to A+ resources today.