Lecture Notes on 24 Feb 2017 Read Chapter 3: Basic Data Structures - Stacks and Queues class Queue (object): def __init__ (self): self.queue = [] def enqueue (self, item): self.queue.append (item) def dequeue (self): return (self.queue.pop(0)) def isEmpty (self): return (len (self.queue) == 0) def size (self): return (len (self.queue)) Depth First Search 0. Start at a given vertex. Mark it current and visited. Push current vertex on the stack. 1. If possible, visit an adjacent unvisited vertex from the current vertex, mark it as current and visited, and push it on the stack. 2. If there are no adjacent unvisited vertex from current vertex, if possible pop a vertex off the stack. Call that current. 3. It there are no adjacent unvisited vertex from current vertex and the stack is empty, then you are done.