I'm looking for a standard algorithm/code (Java) which compares two integer lists (old and new) and gives a third result list which provides actions to convert the 'old' list into the 'new' list.
For example:
old-> 1, 2, 3, 4
new-> 9, 2, 3, 6, 4
so the result should be something like:
1-, 9+, 2, 3, 4-, 6+, 4+
Here, the suffix:
- = Deleted item from old list.
+ = New added item to old list.
and the rest (w/o suffix), are numbers which are unchanged (i.e Value as well as Index). I believe something using the LCS (longest common sequence) would do this job! But I can't really figure-out if there is any.
Any pointers will be highly appreciated.