226. Invert Binary Tree

latest version

T : O(n)

S: O(n)

思路 左邊接右邊dfs, 右邊接左邊 dfs

左右對調就是了, like swapping

or like this

Last updated

Was this helpful?