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 (that is ), then:
  • Case 2. if (that is ), then:
    • (2a) if , then
    • (2b) if , then
    • (2c) if , then
  • Case 3. if (that is ), then:
    • (3a) if , then
    • (3b) if , then

Examples

  • 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)
      • ()
      • ()
    • if then
      • increasing geometry series, thus, the value of is dominated by the last level, which is
    • if then
      • (e.g. merge-sort)
      • constant geometry series
      • each level costs
      • there are levels
      • total cost is
    • if then
      • decreasing geometry series, thus, the value of is dominated by the first level, which is