knapsack problem && dynamical programming BST