From 370ceaf4143a9cafbe45b4ea37f9fd16ee6a4601 Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Wed, 5 Aug 2015 05:45:02 -0400 Subject: [PATCH] Simplified check to determine if there are items in the queue. --- graphs_trees/graph_bfs/bfs_solution.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphs_trees/graph_bfs/bfs_solution.ipynb b/graphs_trees/graph_bfs/bfs_solution.ipynb index 14417ff..94fb659 100644 --- a/graphs_trees/graph_bfs/bfs_solution.ipynb +++ b/graphs_trees/graph_bfs/bfs_solution.ipynb @@ -117,7 +117,7 @@ " queue = deque()\n", " queue.append(root)\n", " root.visited = True\n", - " while len(queue) > 0:\n", + " while queue:\n", " node = queue.popleft()\n", " visit_func(node.id)\n", " for adjacent_node in node.adjacent:\n",