文件名称:leetcodetreenode-leetcode:我个人对leetcode的理解
文件大小:29KB
文件格式:ZIP
更新时间:2024-07-21 03:02:51
系统开源
leetcode treenode leetcode My personal understanding of leetcode ===================================== 建树和序列化树 initialize serialized tree 1 / 2 3 / 4 5 The above binary tree is serialized as "{1,2,3,#,#,4,#,#,5}". The above binary tree is pre_order serialized as "{1,2,#,#,3,4,#,5}". 1.1可以这么建树: int num[] = {1,2,3,e,e,4,e,e,5}; vector vec(num, num+sizeof(num)/sizeof(int)); TreeNode *root = initializeTree(vec); 1.2如果你的编译器支持initializor list(vs 2012至今不支持,但是gcc在4.4就支持了),那就可以这么写: vector vec = {1,2,3,e,
【文件预览】:
leetcode-master
----main.cpp(2KB)
----.gitignore(2KB)
----README.md(958B)
----.gitattributes(483B)
----leetcodeCommon.h(5KB)
----leetcode.h(89KB)
----leetcode.vcxproj.filters(815B)
----leetcode.vcxproj(4KB)