Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following pseudocode is an ecient algorithm to evaluate polynomials. This pseudocode shows how to evaluate a n x n + a n-1 x n-1

The following pseudocode is an ecient algorithm to evaluate polynomials. This pseudocode shows how to evaluate anxn + an-1xn-1 +....+ a1x1 + a0 at x = c. procedure Horner(c; a0; a1; a2; ; ; an : real numbers); y := an for i := 1 to n y := y c + an-i return y {y = ancn + an-1cn-1 + : : : + a1c + a0} (a) Evaluate x3+ 3x2 + x + 1 at x = 2 by working through each step of the algorithm showing the values assigned at each assignment step. (b) Exactly how many multiplications and additions are used by this algorithm to evaluate a polynomial of degree n at x = c? (Do not count additions used to increment the loop variable.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

Students also viewed these Databases questions

Question

Is it clear what happens if an employee violates the policy?

Answered: 1 week ago