0

I read a lot of stuff about Prune and Search algorithm and I even asked some of it for confirmation.

This is a great source. However, some things are hard for me to understand. Like the time complexity of Prune and Search:

Image

Can someone provide a brief explanation for this?

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
KC-Chan
  • 65
  • 7

1 Answers1

0

They're solving the recurrence T(n) <= T(n/5) + T(3n/4) + Cn (C is the big-O constant) via some bizarre method that I don't recognize. Modulo the missing base case and floor and ceiling operators, we can solve it via Akra–Bazzi or the substitution method (this answer).

The inductive hypothesis is that T(n') <= 20Cn' for all n' < n. Then

T(n) <= T(n/5) + T(3n/4) + Cn
     <= 20C(n/5) + 20C(3n/4) + Cn
      = 20C(4n/20) + 20C(15n/20) + Cn
      = 4Cn + 15Cn + Cn
      = 20Cn.
David Eisenstat
  • 64,237
  • 7
  • 60
  • 120