Maximum Sum BST in Binary Tree
Combine each subtree bottom-up, keeping its minimum, maximum and sum, so each node is checked in constant time.
Combine each subtree bottom-up, keeping its minimum, maximum and sum, so each node is checked in constant time.