homomorphism
- 19
- 0
Let's say I have some algorithm with complexity O(n^k) for some constant k. and let's say it runs in some time T. Now, I want to implement a divide and conquer approach for this algorithm, by dividing the problem in half each recursion. So basically, the first time i run my algorithm it will run in time T, the second time it will be O(\frac{n^k}{2^k}) + O(\frac{n^k}{2^k}) [since I'm running my algorithm on both halves] so the time will be \frac{T}{2^k} + \frac{T}{2^k}. and then when i run my algorithm again it will be O(\frac{n^k}{4^k}) * 4. This means the time will be 4 * \frac{T}{4^k}.
So basically, for a worst case scenario, with infinite recursions, I should have some sum,
\sum_{i=0}^{\infty} \frac{T}{2^i^{(k-1)}}
Where T is a constant. does this look about right?
So basically, for a worst case scenario, with infinite recursions, I should have some sum,
\sum_{i=0}^{\infty} \frac{T}{2^i^{(k-1)}}
Where T is a constant. does this look about right?