Complexity of inefficient divide and conquer algorithm -
an instance of size n
divided p≥2
instances each of size n-a
a
small integer
, p
constant
. computation cost of operation (i.e. dividing instances) unit, c(0)=1.
i trying find complexity of design. having trouble putting words equation, here think recursion should like:
c(n) = (n-a)*c(n/p) + 1
is correct?
i think this:
c(n) = (p)*c(n-a) + 1
my rationale said 'p≥2 instances each of size n-a' in question. size reduces c(n-a)
, there p subproblems. think p*c(n-a)
. got other term right. cost of dividing @ each step c(0) = 1
said.
Comments
Post a Comment