In this video we cover how the depth first search algorithm works. We do so by starting with a binary tree and walking through how the algorithm would iterate over the tree searching for a specific node.
We intentionally start with a tree because this removes a lot of complicating factors that might be present in other graphs, such as running into a cycle, but everything you learn here will be applicable to when we start working with cyclical graphs to also run our DFS.
This post is part of the Let's Learn Algorithms series where we learn how algorithms work, see how to implement them, and then spend some time working on practice problems to reinforce how the implementation details work, as well as to help you learn to recognize problems that could be solved using any particular algorithm.
This particular tutorial is part of the section on Graph Theory where we discuss all of the basics about a graph and slowly build our way up to more advanced graph algorithms. This is the first video in the series, so if you are new just sit back and enjoy!
Ready to watch the next video in the series? Representing Binary Trees in Go Code
You can view all of the videos in the Let's Learn Algorithms Graph Theory subsection to see if there is one covering a particular topic you are interested in. You can also check out the transcripts for the video below.
The transcripts below are generated automatically. They aren’t that good and have many errors, but hopefully they help a little bit. If you want you can send corrections for any timestamp.
Sign up for my mailing list and I'll send you a FREE sample from my course - Web Development with Go. The sample includes three chapters from the book, and over 2.5 hours of screencasts.
You will also receive notifications when I release new articles, along with other freebies that I only share with my mailing list.
Jon Calhoun is a full stack web developer who also teaches about Go, web development, algorithms, and anything programming related. He also consults for other companies who have development needs. (If you need some development work done, get in touch!)
Jon is a co-founder of EasyPost, a shipping API that many fortune 500 companies use to power their shipping infrastructure, and prior to founding EasyPost he worked at google as a software engineer.
More in this series
This post is part of the series, Let's Learn Algorithms.
Spread the word
Did you find this page helpful? Let others know about it!
Sharing helps me continue to create both free and premium Go resources.
Want to discuss the article?
©2018 Jonathan Calhoun. All rights reserved.