一般是不写简单题的,但是这题特殊,因为“Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.”
确实很简单,可以递归完成,然后注意交换left和right就行了。
一般是不写简单题的,但是这题特殊,因为“Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.”
确实很简单,可以递归完成,然后注意交换left和right就行了。