We are trying to find the Optimal Binary search tree for a set of nodes and their frequences.

Using Dynamic programing we break the problem down into sub problems (like divide and conquer), except that we keep a record of each sub-problem's solution so that it does not have to be recomputed.

How many nodes do you need?: