mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-07 18:08:01 +00:00
Simplified check to determine if there are items in the queue.
This commit is contained in:
@@ -117,7 +117,7 @@
|
|||||||
" queue = deque()\n",
|
" queue = deque()\n",
|
||||||
" queue.append(root)\n",
|
" queue.append(root)\n",
|
||||||
" root.visited = True\n",
|
" root.visited = True\n",
|
||||||
" while len(queue) > 0:\n",
|
" while queue:\n",
|
||||||
" node = queue.popleft()\n",
|
" node = queue.popleft()\n",
|
||||||
" visit_func(node.id)\n",
|
" visit_func(node.id)\n",
|
||||||
" for adjacent_node in node.adjacent:\n",
|
" for adjacent_node in node.adjacent:\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user