Exponential

Breadth-First Search

Breadth-First Search is an algorithm for searching graph data structures. It starts at a specified source node and explores all its immediate neighbors before moving on to the next level of neighbors.

  • Time complexity is Linear, i.e. O(v + e)
  • Space complexity is Linear, i.e. O(v)
  • For large graphs the space complexity is described in terms of depth making it exponential, i.e. O(b^d)