I'm wrapping up a project for school and for the life of me I cant figure out how to place multiplication signs in the correct places of a math formula.
The basic idea of the project is to multiply matrices in the most optimal way. So, Ive written the code to find the optimal parenthesization and Ive written a function to multiply two matrices together.
I am left with (A1((A2A3)(((A4A5)A6)A7))) where each A is a matrix. I need to place multiplication signs in the correct places so I can put it into an expression tree and evaluate it.
So I need to get from (A1((A2A3)(((A4A5)A6)A7))) to (A1*((A2*A3)*(((A4*A5)*A6)*A7)))
But how?!? Everything I have tried doesn't work!
Any suggestions?! Thanks...