We can also choose other data structures to represent polynomials. For instance, a term can be
represented by ‘struct’ construct of ‘C’ as shown below:
struct term
{
int coef;
int exp;
};
and the polynomial called ‘pol’ of ten terms can be represented by an array of structures of type ‘term’
as shown below:
struct term pol1[10];
Now the algorithm merge() can be applied to add two such polynomials with above chosen data
structures. It is left as an exercise ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.