Sunday, December 27, 2009

Maximum of Binary Sub Tree

public Node getMaxOfSubTree(Node n)
        {
            if (n.Left == null && n.Right == null) return n;
            Node t = n;
            while (t.Right != null)
            {
                t = t.Right;
            }
            return t;
        }

No comments:

Node.JS rest api Tutorials