Dynamic Programming21 sections · 916 units
Open in CourseQuiz: LIS Basics
Knowledge check
Check Your Understanding
What is the recurrence relation for LIS with dp[i] = length of LIS ending at index i?
- A.dp[i] = min(dp[j]) for all j < i
- B.dp[i] = dp[i-1] + 1
- C.dp[i] = dp[i-1] if arr[i] > arr[i-1]
- D.dp[i] = max(dp[j]) + 1 for all j < i where arr[j] < arr[i]