Question: I'm really new to time complexity, could you justify the answer from one sentence to another Problem 1. Consider the problem of evaluating a polynomial

 I'm really new to time complexity, could you justify the answer

I'm really new to time complexity, could you justify the answer from one sentence to another

Problem 1. Consider the problem of evaluating a polynomial The input is defined by a value x and a polynomial p represented as an array A = [ao, ai, . . ., an] of coefficients. The output should be p(x) Assuming each addition and multiplication takes O(1) time, you are to analyze the complexity of two algorithms for this task. The first one, is a naive strategy that computes each term of the polynomial from scratch 1: function NaivE(x, A) 2:answer- 0 3: n length of A 4 for i from 0 to n do aux - ]1 for i from 1 to i do 7: 8: answer-answer + aux * Ai] return answeir The second one, is based on Horner's rule for polynomial evaluation. 1: function HORNEr(X,A) 2: answer =0 3: nlength of A 4 for i from n to 0 do answer - A[i] +answer*x return answer a) Using O-notation, upperbound the running time of Naive b) Using O-notation, lowerbound the running time of NAIvE to show that your upperbound is in fact asymptotically tight. c) Using O-notation, upperbound the running time of Horner

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!