Graph Search
Learn how to implement a graph search algorithm in Swift.
StartGraph Search: Swift
Lesson 1 of 1
- 1Welcome back to the Graph data structure! In this lesson, we’ll implement graph searching algorithms, also known as traversals. Traversals are incredibly useful when you are trying to find a parti…
- 2So far, we are able to traverse the entirety of the graph. However, there will be a problem if the graph has a cycle. If there was a cycle, for example a path from one vertex to itself, we would b…
- 3Now it’s time to focus on breadth-first traversal! As a reminder, the breadth-first traversal iterates through the graph in layers. It goes down one layer, which comprises of the start node’s direc…
- 4So far, we are able to traverse the entirety of the graph. However, just like for our depth-first traversal, there will be a problem if the graph has a cycle. If a graph contains a cycle, we would…
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory