Longest Common Subsequence
...with an unconventional approach
This is a three way LCS solution using a ‘sparse’ data structure and an intuitive conceptual model to aid your understanding.
...with an unconventional approach
Sorting an array can be done in different ways. It ranges from the simpler bubble sort to more complicated ones such as the merge sort.
A linked list is a sequential data structure. A head pointer points to the first node and each node has a pointer to the next. The last node is suitably terminated. Manipulating a linked list is an exact exercise and reversing it certainly so. Would a cutaway view be helpful?
Dynamic Programming is an algorithmic technique to solve constrained, combinatorial optimization problems. The Knapsack here is a metaphor for the constraint. The ‘knapsack’ might as well be a container ship.
Bubble sort with attitude
Bubble sort at your pace
Watch the algorithm converge...!