logo

AQA A-Level Computer Science practice

A depth-first search starts at A and considers neighbours in the order shown. A: B, C; B: D; C: E; D: F; E: F; F: none. Which is the order in which vertices are first visited?

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

At a glance

MCQ

Type

practice

Style

Topic

Graph-traversal

Exam-style question

Try this first

A depth-first search starts at A and considers neighbours in the order shown. A: B, C; B: D; C: E; D: F; E: F; F: none. Which is the order in which vertices are first visited?.

  1. A.A, B, C, D, E, F
  2. B.A, B, D, F, C, E
  3. C.A, C, E, F, B, D
  4. D.A, B, D, C, E, F

Answer and explanation

Concise answer

A, B, D, F, C, E

Why this is correct

Depth-first search follows the first available branch as far as possible. It visits A, B, D and F before backtracking to C and then visiting E.

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