Depth First Search graph search algorithm uses ______ data structure for its…

2020

Depth First Search graph search algorithm uses ______ data structure for its implementation.

  1. A.

    Stack

  2. B.

    tree

  3. C.

    Dequeue

  4. D.

    Queue

Attempted by 484 students.

Show answer & explanation

Correct answer: A

The correct answer is A: Stack. Depth First Search (DFS) explores a graph by going as deep as possible along each branch before backtracking. This Last-In, First-Out (LIFO) behavior is inherently managed using a Stack data structure (either explicitly or implicitly via recursion).

Explore the full course: Niacl Ao It Specialist