Breadth First Search
Breadth-First Search (BFS) is the next traversal algorithm we'll cover. BFS is a level-by-level traversal algorithm that starts at a node in a tree or graph-like data structure and processes all nodes at the current level before moving to the nodes at the next level.
This module teaches you how to solve coding interview questions using breadth-first search by focusing on questions that are best solved using BFS rather than Depth-First Search. It's divided into 2 sections:
Binary Trees
We start by learning how breadth-first search traverses the nodes in a binary tree, which will teach us the fundamentals of the algorithm. We then look at practice problems that are best solved using BFS.
Graphs
We then look at the two most common ways graphs are represented during the coding interview, and how to traverse both representations with BFS. Then we work through problems that give us practice with the different types of graph problems that are best solved using BFS.
© 2024 Optick Labs Inc. All rights reserved.
Loading comments...