So, I have a little problem. I made a program that multiplies 2 polinomials. The resulting vector being one of type struct which contains the exponent and coefficient. I managed to sort the resulting vector in decreasing order with respect to the exponent, and now i need to add the coefficients of the terms that have the same exponent and I don't know how to do that. Any ideas?
It would be helpful to give us the code you allready have.
Basically you can use the same sorting algorithm you allready have, but this time you check only the elements with the same exponent and you sort by coefficients.