Invert Binary Tree
Understand and solve the interview question "Invert Binary Tree".
We'll cover the following...
Description
In this lesson, your task is to invert a given a binary tree, T
.
Let’s look at an example below:
class TreeNode(var value:Int=0, var left:TreeNode=null, var right:TreeNode=null) {}object Solution {def invertTree(root: TreeNode): TreeNode = {//write your code hereroot}}
Invert binary tree
...