MCPcopy Index your code
hub / github.com/geekcomputers/Python / bfs

Function bfs

binary_search_tree.py:196–206  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

194
195# Levelwise
196def bfs(node):
197 queue = []
198 if node:
199 queue.append(node)
200 while queue != []:
201 temp = queue.pop(0)
202 print(temp.info)
203 if temp.left:
204 queue.append(temp.left)
205 if temp.right:
206 queue.append(temp.right)
207
208
209def preorder_itr(node):

Callers

nothing calls this directly

Calls 2

appendMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected