Added dynamic programming and hash algorithms