Differences
This shows you the differences between two versions of the page.
| courses:cs211:winter2018:journals:holmesr:section_3.3 [2018/02/05 19:33] – created holmesr | courses:cs211:winter2018:journals:holmesr:section_3.3 [2018/02/06 03:41] (current) – holmesr | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Breadth-First Search and Depth-First search often produce quite different trees, but their mechanics are very similar and in fact their essential difference is one's using a queue versus the other' | Breadth-First Search and Depth-First search often produce quite different trees, but their mechanics are very similar and in fact their essential difference is one's using a queue versus the other' | ||
| + | |||
| + | Breadth-First Search works in O(// | ||
| + | |||
| + | Depth-First Search makes a stack which initially only contains the root node //s//. It then enters a loop which takes the first item off the stack, marks it as explored, adds all its adjacent nodes to the stack and repeats the loop until the stack is empty. This algorithm also runs in O(// | ||
| + | |||
| + | The one thing I didn't understand about this chapter is the how a BFS could be implemented using a queue. The chapter promised that this was true but didn't really explain how, at least in my eyes. | ||
