In-order iterative solution, right child first, then root, then left child; while visiting nodes, add past nodes' value to sum, add sum to current node value

```
public TreeNode ConvertBST(TreeNode root) {
var node = root;
var sum = 0;
var s = new Stack<TreeNode>();
while(s.Count!=0 || node != null)
{
if(node != null)
{
s.Push(node);
node = node.right;
}
else
{
node = s.Pop();
var t = node.val;
node.val += sum;
sum += t;
node = node.left;
}
}
return root;
}
```