Given two polynomials represented by two linkedlists that contains the coefficients of poynomials. Your task is to complete the method proOfPolynomials() which takes four arguments: the address of the head of the linked list1, the address of the head of the linked list2, size of linked list1 and size of linked list2. The function returns the head of a linked list formed after multiplication of given polynomials.
The first line contains an integer T, depicting total number of test cases. First line of each test case contains two integers M and N,highest degree of the polynomial linked list1 and linked list2. Next two line contains M and N integers , decribes the coefficients of polynomials.
Print the coefficients of resultant poynomial.
The task is to complete the function proOfPolynomials() which should multiply the given polynomial.
1 <= T <= 100
1 <= M, N <= 100
1 <= size of list1 & list2 <= 100
1 0 3 2
2 0 4
1 9 3 4 7
4 0 2 5
2 0 10 4 12 8
4 36 14 39 79 23 34 35
1 + 0x^1 + 3x^2 + 2x^3
2 + 0x^1 + 4x^2
2 + 0x^1 + 10x^2 + 4x^3 + 12x^4 + 8x^5
1 + 9x^1 + 3x^2 + 4x^3 + 7x^4
4 + 0x^1 + 2x^2 + 5x^3
4 + 36x^1 + 14x^2 + 39x^3 + 79x^4 + 23x^5 + 34x^6 + 35x^7
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.