I'm currently working on a project that calculates polynomial expressions (We got this for a task at University). I'm storing a polynomial in a linked list and I've overloaded operators +,*,-,' for polynomials. The most difficult task that I've got is to parse an expression like this e.g. : (3x-(-x-1)^2)(x^3-2x^2+1)''
where '' is second derivative. I've been googling a lot and couldn't find antyhing that could parse and make an postfix expression out of this when you have a variable x and numbers, is there a way to modify Shunting-Yard algorithm so that it could work on polynomials?
My node stores coefficient, power, pointer to the previous and next node and my Polynomial class supports every operation thats stated above. The only problem is how can I get a postfix expression out of a string that I put above? Btw. only '(' & ')' parentheses are supported, that makes it a bit easier.
For the example (3x-(-x-1)^2)(x^3-2x^2+1)''
I need to store the result of it in a polynomial that I made.
I can provide more if asked, Thanks in advance!