Longest Common Subsequence in Java
I am trying to implement the longest common subsequence algorithm in Java. I have been following the instructions on the blog, but I am getting stuck at the following step:
int[][] dp = new int[n + 1][m + 1];
I am not sure how to initialize the dp array. The blog post says that it should be initialized to 0, but I am getting an error when I do that.
Can anyone help me with this?
Add comment