MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

PolynomialAddition.cpp:110–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}poly; //Data Structure (Linked List) based polynomial addition
109
110int main(){
111 term *first1 = NULL;
112 poly p1;
113 first1 = p1.addTerm(first1, 0, 1);
114 first1 = p1.addTerm(first1, 5, 2);
115 first1 = p1.addTerm(first1, 3, 4);
116 first1 = p1.addTerm(first1, 4, 9);
117
118 term *first2 = NULL;
119 poly p2;
120 first2 = p2.addTerm(first2, 0, 2);
121 first2 = p2.addTerm(first2, 5, 9);
122 first2 = p2.addTerm(first2, 3, 10);
123 first2 = p2.addTerm(first2, 7, 3);
124
125 cout << "First Polynomial : " << endl;
126 p1.printPoly(first1);
127 cout << "Second Polynomial : " << endl;
128 p2.printPoly(first2);
129 cout << endl << endl;
130
131 term *firstR = NULL;
132 poly result;
133 firstR = result.add(first1, first2, firstR);
134 cout << "Sum of polynomials : " << endl;
135 result.printPoly(firstR);
136}

Callers

nothing calls this directly

Calls 3

addTermMethod · 0.80
printPolyMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected