Microsoft Interview Question

A form of the knapsack problem, another question on binary trees.