Substitution method

  • (quick sort worst case (e7.2-1))
  • (worst-case of Random in Ramdomized-Quicksort (e7.3-2))
  • (4.1)
  • (e4.1-1)

Rucursion-tree method

  • dsd

Changing variables

  • Given
  • Define:
  • Therefore,

Master Theorem

1. for some constant
2.
3. for some constant , and if for some constant and all sufficiently large

2 -

  • Case 1. if (i.e. ) then:
  • Case 2. if (i.e. ) then:
    • (2a) if , then
    • (2b) if , then
    • (2c) if , then
  • Case 3. if (i.e. ) then:
    • (3a) if , then
    • (3b) if , then

Exmaples

  • Case 1:
    • ()
    • ()
    • (best-case of Random in Ramdomized-Quicksort (e7.3-2))
  • Case 2:
    • (2a)
      • () (max-heapify)
      • (quick-sort best case; merge-sort)
  • Case 3:
    • (3a)
      • ()
      • ()