1

For example, we have $T(N) = T(N/2) + T(N/5) + O(N)$. So:

$2T(N/2) + O(N) \leq T(N) \leq 2T(N/5) + O(N)$

$O(N) \leq T(N) \leq O(N)$. Thus, $T(N) = O(N)$. Is it correct?

Maczinga
  • 460
  • 2
  • 8
Alexander
  • 11
  • 2
  • Why should $T(n)\leq 2T(N/5)+O(N)$? – Maczinga Feb 28 '17 at 20:13
  • 2
    We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. – David Richerby Feb 28 '17 at 20:18
  • Welcome to [cs.SE]! Your question is a very basic one. We get asked this kind of thing a lot, so we've written some reference material on the subject. Let me direct you towards our reference questions which cover your problem in detail, in particular http://cs.stackexchange.com/q/2789/755. I suggest you work through the material there, try to solve your problem again, and if you're still stuck, edit to include your attempts along with the specific problems you encountered. Your question may then be considered for reopening. Good luck! – D.W. Feb 28 '17 at 20:22
  • O(N) is a set of functions. Algebraic manipulations like you do are very dubious. The ones that you wrote even more so. On the other hand, T(n) = cn + d solves the recurrence. – gnasher729 Feb 28 '17 at 23:36

0 Answers0