MergeSort

Finding the middle of a linked list

fast-slow pointer.

  1. fast runner goes 2 steps each time
  2. slow runner goes 1 step
  3. when fast reach the end of the linked list, the slow id the middle of the list