[next] [prev] [prev-tail] [tail] [up]
The following describes the algorithm for each case separately. The easiest one is for case 1, and the hardest is for case 3. Many examples will also be given at the end of the algorithm describing to show how it works.
[next] [prev] [prev-tail] [front] [up]