The BFS (Breadth-First Search) algorithm explores a graph level by level, starting from a given node. It uses a queue to manage nodes to be visited and a set to keep track of visited nodes. The algorithm processes the starting node, then its adjacent nodes, adding them to the queue if they haven’t been visited yet. It continues this process until all reachable nodes are visited. BFS is often used for tasks like finding the shortest path in an unweighted graph or checking if a graph is connected.
Continue this lesson in the app
Install CourseHive on Android or iOS to keep learning while you move.
FAQs
We curate free YouTube courses, organized by category and language — and make it easy for you to track your learning progress.
Yes. Free courses are embedded YouTube videos.
Currently available in English — with Portuguese, Spanish, French, German, and Italian coming soon.
Check ratings, reviews, duration, and description.
All courses include a certificate of participation.
Yes, an account lets you track progress, earn certificates, and save favorites.
We auto-save your watch position so you can resume on any device.