looking for Dynamic calculation algorithm

Joined
Dec 22, 2009
Messages
7
Reaction score
0
Hi,


I am looking for an algorithm that will help me resolve this issue:

I will recieve a string that will contain calculation, such as:
"(a*(b+c))/d" and I will need to return the answer.
I know that there is an algorithm for such problems. (better example in c++, if possible)
can anyone help me with that?
It is quite urgent.

Thanks in advance,
Inbal
 
Joined
Dec 22, 2009
Messages
7
Reaction score
0
I found the Reverse Polish Notation, that answerd my question.
If anyone runs into the same issue, they can use the following links:
en.wikipedia.org/wiki/Reverse_Polish_notation
and :
en.wikipedia.org/wiki/Shunting-yard_algorithm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top