logo

Question detail

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, check the answer, then read the explanation to understand the curriculum point.

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

Model answer

What a good answer should say

  • A, B, D, F, C, E

Explanation

Why this works

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.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.