Quicksort, Lomuto partition, last element as pivot:
  partition [22 10 15 3 8 2] pivot 2 -> [2 10 15 3 8 22], pivot at 0
    partition [10 15 3 8 22] pivot 22 -> [10 15 3 8 22], pivot at 5
      partition [10 15 3 8] pivot 8 -> [3 8 10 15], pivot at 2
        partition [10 15] pivot 15 -> [10 15], pivot at 4
  result [2 3 8 10 15 22], comparisons = 13, swaps = 3
Quicksort, Hoare partition, middle element as pivot:
  partition [22 10 15 3 8 2] pivot 15 -> [2 10 8 3] [15 22]
    partition [2 10 8 3] pivot 10 -> [2 3 8] [10]
      partition [2 3 8] pivot 3 -> [2 3] [8]
        partition [2 3] pivot 2 -> [2] [3]
    partition [15 22] pivot 15 -> [15] [22]
  result [2 3 8 10 15 22], comparisons = 24, swaps = 3
Pivot rules on 3000 elements (Lomuto):
  sorted input, last element: 4498500 comparisons, depth 2998
  sorted input, median of three: 28917 comparisons, depth 10
  sorted input, random: 41022 comparisons, depth 23
  random input, last element: 38004 comparisons, depth 23
  random input, median of three: 33207 comparisons, depth 18
  random input, random: 40509 comparisons, depth 27
