I am working in java, and I have to evaluate mathematical expressions given as a String. For example:
"5*8-9/7+5-8"
will result in
35.71.
I tried for "java eval library" , but found no help. Please tell me how to resolve this sort of problem. I can evaluate expression like these using data structure stack or queue but i have to consider operator precedence as multiplication is done prior to subtraction,addition. What data structure will suit this situation best keeping in mind time complexity.