Binary Tree, Data Structure Algorithm, Algorithms, Dotnet, Csharp.
(predecessor.right != null && predecessor.right != node) { predecessor = predecessor.right; } // If the predecessor's right child is null, link it to the current node and move to the left child if (predecessor.right == null) { // Add the value of the current node to the output list