Define a traverse operation for the adt polynomial that


1) Consider a sparse implementation of the ADT polynomial that stores only the terms with nonzero coefficients. For example, you can represent the revised polynomial p with the linked chain shown in Figure 4-10.

a. Complete the sparse implementation.

b. Define a traverse operation for the ADT polynomial that will allow you to add two sparse polynomials without having to consider terms with zero coefficients explicitly.

2) When you play a board or card game or when you use a shared computing resource, you get a turn and then wait until everyone else has had a turn. Although the number of players in a game remains relatively static, the number of users of a shared computing service fluctuates. Let's assume that this fluctuation will occur.

Design an ADT that keeps track of turns within a group of people. You should be able to add or delete people and determine whose turn occurs now.

Begin with a given group of people; assign these people an initial order. (This order can be random or specified by the user.) The first new person joining the group should get a turn after all others have had an equal number of turns. Each subsequent new person should get a turn after the person who joined the group most recently has had a turn.

Also design an ADT to represent a person. (You can be conservative with the amount of data that this ADT contains.) The data that your first ADT stores is made up of instances of the ADT person.

Implement your ADTs as C++ classes. Write a program that uses-and therefore tests-your ADTs completely. Your program should process several insertion and deletion operations, and demonstrate that people are given turns correctly.

These homework problems are taken from the Textbook: Data Abstraction & Problem Solving with C++ (6th Edition) by Frank M. Carrano and Timothy Henry. (Homework Problems on page 156 & 157).

The home work is based on chapter 4 (Linked Based Implementation).

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Define a traverse operation for the adt polynomial that
Reference No:- TGS01401306

Expected delivery within 24 Hours