MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / _serialize

Method _serialize

Tree/SerializeAndDeserializeBinaryTree.py:142–153  ·  view source on GitHub ↗
(roots)

Source from the content-addressed store, hash-verified

140 result = []
141
142 def _serialize(roots):
143 _next = []
144 for i in roots:
145 if i:
146 result.append(i.val)
147 _next.append(i.left)
148 _next.append(i.right)
149
150 else:
151 result.append(None)
152
153 return _next
154
155 base = _serialize([root])
156

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected