how i master postulate news recursion?


recently i have study recursion; it, investigate it, etc. i have guess while order recursion same thing, nonetheless problems new task assignments quizzes have me pondering there slight differences, 'recurrence' proceed news recursive way function.



this unequivocally greek me until recently, i satisfied there something called 'master theorem' used 'recurrence' problems programs. i've reading by wikipedia page, but, usual, things worded such proceed i don't unequivocally know it's articulate about. i learn many improved examples.



so, few questions:
lets contend given recurrence:




r(n) = 2*r(n-2) + r(n-1);

r(1) = r(2)
= 1




is this, fact, form master theorem? so, words, saying? perplexing little way tree recursion formed recurrence, feeling like? should i only try substituting numbers in, observant pattern, following minute pseudocode recursively emanate pattern, or, given competence form master theorem, there some-more straightforward, mathematical approach?



now, lets contend asked recurrence, t(n), array additions achieved way combined before recurrence. i bottom box substantially t(1) = t(2) = 0, nonetheless i'm certain where there.



basically, i am seeking given order code, opposite. given looks master theorem, i'm wondering there candid mathematical proceed going it.



edit: okay, i've looked by past assignments another instance where i'm asked, 'to recurrence', biased doubt i'm carrying post problem with.




recurrence describes best
proceed array offer operations
following way fragment
(when called l == 1 r == n)




int example(a, int l, int r) {
(l == r)
relapse 2;
relapse (a[l] + example(a, l+1, r);
}


Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?