logo

AQA A-Level Computer Science practice

During a trace of Dijkstra’s algorithm, a vertex has a current tentative distance of 6. A route through the vertex currently being processed would give that vertex a distance of 9. What should happen to the tentative distance?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Optimisation algorithms

Exam-style question

Try this first

During a trace of Dijkstra’s algorithm, a vertex has a current tentative distance of 6. A route through the vertex currently being processed would give that vertex a distance of 9. What should happen to the tentative distance?.

  1. A.It should be changed to 9
  2. B.It should remain 6
  3. C.It should be changed to 3
  4. D.It should be changed to infinity

Answer and explanation

Concise answer

It should remain 6

Why this is correct

The existing tentative distance of 6 is shorter than the newly calculated distance of 9, so it is not replaced.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions