Longest Common Subsequence in Java

Forums JavaScriptLongest Common Subsequence in Java
Staff asked 12 months ago

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?


Subscribe

Select Categories