Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For all program or data structure design problems such as the two below you must provide pseudocode and an adequate explanation of the methods. It

For all program or data structure design problems such as the two below you must provide pseudocode and an adequate explanation of the methods. It is often helpful to include small examples demonstrating the methods. Straight pseudocode with no additional documentation is not enough.

image text in transcribed

Coding life - spent 6 hours and still can't get the equation right

C++ (Java)

CSC 202 Programming Assignment #4 For all program or data structure design problems such as the two below you must provide pseudocode and an adequate explanation of the methods. It is often helpful to include small examples demonstrating the methods. Straight pseudocode with no additional documentation is not enough. 1. The classic way to evaluate a polynomial is Horner's Rule. Horner's rule can be stated recursively as follows: Let P(x) = ao + aj*x+ a2*x^2 + ... + a)*x^k be a polynomial. Note that * means "times and means "to the power". To evaluate the polynomial p(x) at c, first let r be the result of evaluating the polynomial aj + a2*x+ 23*x^2 + ... + ak*x^(k-1) at c, then evaluate the final result as ao + c*r. Design recursive pseudocode function which more precisely defines Horner's Rule. Assume that the coefficients of the polynomial is stored in a linked list with all stored at the head of the list. Your function should have two arguments one for the number c and the other for the polynomial. The return value should be a number. Design an iterative algorithm (no recursion) and its pseudocode for Horner's Rule. Your iterative algorithm should be a simple for loop. In this case assume that the polynomial is stored in an array, not a linked list. The array value A[0] = a0, A[l] = al, and so on. 2. Consider the linked list representation of unbounded integers. Carefully design a recursive function function that adds two integers. The Your addition function should have two arguments which are node pointers, and return a node pointer

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

Step: 3

blur-text-image

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions