KAUST CEMSE CS TREES Dynamic Programming