package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev
# README
222. Count Complete Tree Nodes
Solution idea
普通二叉树的解法
Post-Order Traversal: 左子树汇报,右子树汇报,当前层干点什么
Time complexity = $O(n)$
利用性质
Complete Binary Tree一定会有一个 full binary subtree (满二叉树)
Time complexity $< O(n)$