update Recursive and DP