Cat2adding Two Polynomials Using Linked List
Cat2adding Two Polynomials Using Linked List
Example:
Input:
1st number = 5x^2 + 4x^1 + 2x^0
2nd number = 5x^1 + 5x^0
Output:
5x^2 + 9x^1 + 7x^0
Input:
1st number = 5x^3 + 4x^2 + 2x^0
2nd number = 5x^1 + 5x^0
Output:
5x^3 + 4x^2 + 5x^1 + 7x^0
// C++ program for addition of two polynomials
// using Linked Lists
#include<bits/stdc++.h>
using namespace std;
// Driver program
int main()
{
struct Node *poly1 = NULL, *poly2 = NULL, *poly = NULL;
return 0;
}
Output: