Re: Analysis of Algorithms

That is Horner's rule: for a polynomial a(n)*x^(n) +a(n-1)*x^(n-1) + ... a(0), the polynomial can be rewritten as: x*(a(n)*x^(n-1) ... a(1))+a(0). If you recursively apply this rule to the polynomial (of lower degree) you can see that it takes n-1 multiplications and n-1 additions to evaluate the entire polynomial.

kind regards,

Jos

Re: Analysis of Algorithms

Hmm, interesting and thank you. I am still having trouble finding how many additions and multiplications total.

Re: Analysis of Algorithms

Erm, I gave the answer already.

kind regards,

Jos

Re: Analysis of Algorithms

Oh sorry. I read that as soon as I woke up and things didn't click lol. My bad.

Thank you again!

Re: Analysis of Algorithms

Quote:

Originally Posted by

**rhym1n** Oh sorry. I read that as soon as I woke up and things didn't click lol. My bad.

Thank you again!

You're welcome and the only things that click when I wake up are the on/off switch of my espresso machine and my llghter for my first sigaret of the day ;-)

kind regards,

Jos