package
0.0.0-20241125063422-a7e1e0bf04b0
Repository: https://github.com/blueblue0102/leetcode-go.git
Documentation: pkg.go.dev
# README
226. Invert Binary Tree
https://leetcode.com/problems/invert-binary-tree/
將樹左右翻轉,也就是簡單的左右互換即可
每個 node 都要進行一次左右互換
所以這題的本質是要做 tree 的 traversal
Takeaway
- Tree Traversal