š Longest Palindromic Substring
Dynamic Programming Approach Visualization
DP Table: dp[j][i] = is substring from j to i a palindrome?
Current Longest Palindrome
Not found yet
Length: 0
Step 0: Ready to Start
Use the slider or +/- buttons to step through the Dynamic Programming algorithm.
š Algorithm State
Current i: 0
Current j: 0
Max Length: 1
String Length: 5
š Algorithm Info
Approach: Dynamic Programming
Time Complexity: O(n²)
Space Complexity: O(n²)
Table Size: 5Ć5
Key Insight: dp[j][i] = true if s[j] == s[i] AND
(i-j ⤠2 OR dp[j+1][i-1] is true)