One way to serialize a binary tree is to use pre-oder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as #. _9_ / \ 3 2 / \ / \ 4 1 # 6 / \ / \ / \ # # # # # # For
if __name__== "__main__" 的意思(作用)python代码复用 转自:大步's Blog http://www.dabu.info/if-__-name__-__main__-mean-function-python-code-reuse.html 有人在学习python脚本时会发现有的脚本下面有几行代码; 1 2 if __name__== "__main__": main() 不明白其中的意思,其实这就是方便我们代码复用的,我们可以在