0
votes

Assume that the size of the input problem increases with an integer n. Let T(n) be the time complexity of a divide-and-conquer algorithm to solve this problem. Then T(n) satisfies an equation of the form:

T(n) = a T(n/b) + f (n).

Now my question is: how can a and b be unequal?

It seems that they should be equal because the number of recursive calls must be equal to b (size of a sub-problem).

1

1 Answers

0
votes

In software, time is often wasted on control operations, like function calls. So usually a > b.

Also, there are situations where the problem calls for just one "recursive call" (which would then be just iteration), for example, binary search. In these cases, a < b.