This video explains how to use the BFS (Breadth-First Search) algorithm to check whether a graph is connected or disconnected. A connected graph is one where every node is reachable from any other node, while a disconnected graph has at least one pair of nodes that are not connected by any edge. The video demonstrates how to implement a Python program that uses BFS to traverse a graph and determine its connectivity by checking if all nodes are visited. If all nodes are visited, the graph is connected; otherwise, it is disconnected.
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.