Amazon Interview Question

heaps, graphs, trees using dynamic programming