BFS
107 Binary Tree Level Order Traversal II 49.30% Easy
429 N-ary Tree Level Order Traversal 61.70% Medium
104 Maximum Depth of Binary Tree 63.30% Easy dfs bfs bfs需要额外的stack来储存深度信
872 Leaf-Similar Trees 64.50% Easy dfs 一步一步比 普通dfs汇总比
637 Average of Levels in Binary Tree 60.60% Easy iterative bfs
226 Invert Binary Tree 60.90% Easy iterative dfs bfs都能做 让波波练习写iterative bfs dfs
513 Find Bottom Left Tree Value 60.10% Medium dfs也可以做
515 Find Largest Value in Each Tree Row 59.20% Medium dfs也可以做
919 Complete Binary Tree Inserter 56.10% Medium
199 Binary Tree Right Side View 51.30% Medium 最优:dfs,始终保证最右先走,然后第一个到达新的depth,就存起来。
958 Check Completeness of a Binary Tree 51.00% Medium 想想怎么优化,bfs能优化到100% dfs也能做到100%,需要用到complete tree的性质
103 Binary Tree Zigzag Level Order Traversal 45.10% Medium dfs和bfs都可做。但是用recursive的dfs明显更有优势
662 Maximum Width of Binary Tree 39.60% Medium dfs也可做 主要是用index来做文章
116 Populating Next Right Pointers in Each Node 41.70% Medium bfs超过了constant space 考虑完全二叉树和next指针可以怎么历用 可用dfs
117 Populating Next Right Pointers in Each Node II 37.00% Medium dfs怎么用