adding code - DP, D&C and Sorting.