# 897. Increasing Order Search Tree!

```java
/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution {
    public TreeNode increasingBST(TreeNode root) {
        return inOrderTraversal(root, null);
    }
    
    private TreeNode inOrderTraversal(TreeNode node, TreeNode next){
        if (node == null) return next;
        
        TreeNode left = inOrderTraversal(node.left, node);
        node.left = null;
        node.right=inOrderTraversal(node.right, next);
        return left;
    }
}
```
