Simplified check to determine if there are items in the queue.

This commit is contained in:
Donne Martin 2015-08-05 05:45:02 -04:00
parent bad87c9f87
commit 370ceaf414

View File

@ -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",