Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help using below template A polynomial may be represented as a linked list where each node contains the coefficient and exponent of a term

image text in transcribed

Please help using below template

image text in transcribed

A polynomial may be represented as a linked list where each node contains the coefficient and exponent of a term of the polynomial . The polynomial 4 X - 3 X2 5 would be represented as a linked list given below. Equation1 43 -3 2 -5 0 Write a program system that reads two polynomials in any order of exponent from an input file, stores them as linked lists and prints the polynomial in a sorted order to an output file NOTE: Must write a very general program using Object oriented concept. Do not use any library functions. All methods used in the program MUST be written in C++ and included in the program. KEYWORDS: Classes Pointers Submit a. Documented program b. Input file. c. Output file. Test run for the following inputs (Do not change the order of exponent in the input file) A) Equationl : 18X5 7x + 6x2 + 6 Equation 2 : 8x - 7x4 +6X +972 8X+9 Equation 3 : 8X - 7x + 6X2 +6 Equation : 8X - 7x2 + 6x4 + 9x - 8 Equations : 8X - 6+ 5x + 6x + 8X8 7x?+6X Equation : 9x - 6X2 + 5x4 + 18X-9 struct nodetype { int coeff; int exp; nodetype *next; class equation { private: nodetype "begin, *last; int length; public: //Default constructor equation(); // Method to insert an item in the linked list in a sorted order void insertitem( nodetype temp); // Method to output all the items in the linked list void printlist(); // Method to add two equation equation add(equation e2)

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

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions