Binary Tree, Data Structure Algorithm, Algorithms, Dotnet, Csharp.
null) { // Add the value of the current node to the output list output.Add(node.val); // Move to the right child of the current node node = node.right; } else { // If the current node has a left child // Find the predecessor of the current node TreeNode predecessor = node.left; while