Let p(x) be a polynomial of degree n, that is, p(x) = n i=0 a i

Question:

Let p(x) be a polynomial of degree n, that is, p(x) = Σni=0 aixi.

a. Describe a simple O(n2)-time algorithm for computing p(x).

b. Describe an O(nlogn)-time algorithm for computing p(x), based upon a more efficient calculation of xi.

c. Now consider a rewriting of p(x) as

p(x) = a0+x(a1+x(a2+x(a3+···+x(an−1+xan) ···))),


which is known as Horner’s method. Using the big-Oh notation, characterize the number of arithmetic operations this method executes.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Data Structures and Algorithms in Java

ISBN: 978-1118771334

6th edition

Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

Question Posted: