Which of the following data structures is used to implement a Breadth-First…

2025

Which of the following data structures is used to implement a Breadth-First Search (BFS) algorithm ?

  1. A.

    Stack

  2. B.

    Queue

  3. C.

    Tree

  4. D.

    Array

Attempted by 243 students.

Show answer & explanation

Correct answer: B

BFS uses a Queue data structure because it follows FIFO order to explore nodes level by level. This ensures all neighbors at current depth are processed before moving deeper.

Explore the full course: Niacl Ao It Specialist