/* poly.h - header file for CS 60 assignment 3, Fall 2009 - data types and operations to manage polynomials - terms are nodes of a linked list cmc, updated 10/22/09 DO NOT EDIT THIS FILE - you will not turn it in. */ #ifndef POLY_H #define POLY_H /* polynomial data types */ struct pnode { unsigned exponent; double coeff; struct pnode *next; }; typedef struct pnode Term, /* one term of a polynomial */ *Poly; /* pointer to such a term, or start of list */ /* prototypes for functions you must implement for this project (see instructions): */ void addTerm(double, unsigned, Poly *); double value(Poly, double); int degree(Poly); int count(Poly); Poly sum(Poly, Poly); Poly diff(Poly, Poly); Poly mult(Poly, Poly); void freePoly(Poly *); /* prototypes for functions already implemented in poly.c-skeleton */ Term *newTerm(double, unsigned); void freeTerm(Term *); int termsCreated(void); int termsFreed(void); #endif