University of Sao Paulo Replacement & Asymptotic Method of an Algorithm Questions

User Generated

SylvatCvt

Programming

University of Sao Paulo

Description

I have to analyse an algorithm and explain how to reach the answers in detail!
I must know:

recurrence equation, recurrence tree, general term, hypothesis, replacement method, asymptotic analysis

Unformatted Attachment Preview

I want to analyze the following algorithm and show him(with explanations of how to achieve each answer), the: 1) recurrence equation 2) recurrence tree 3) general term 4) hypothesis 5) replacement method 6) asymptotic analysis of the algorithm. Here is the algorithm: #include int bigRec(int *v, int beg, int end) { if (beg == end) return v[beg]; if (end - beg == 1) return (v[end] > v[beg]) ? v[end] : v[beg]; int p1 = (end - beg) / 3 + beg; int p2 = 2 * (end - beg) / 3 + beg; int m1 = bigRec (v, beg, p1); int m2 = bigRec (v, p1+1, p2); int m3 = bigRec (v, p2+1, end); int m = m1; m = (m2 > m) ? m2 : m; m = (m3 > m) ? m3 : m; return m; } int main (int argc, char *argv[]) { int v[100]; int x; int n=0; while (scanf("%d", &x) !=E0F && n
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

https://docs.google.com/document/d/14itpw7wJZIWYbL...
Please sh...


Anonymous
Great content here. Definitely a returning customer.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags