algorithm - calculate a simple expression in java -


how can evaluate infix expression in java : ((1)2/4+2-1). knew can use 2 stacks : 1 1st characters(+-/). 2nd integers.

then check priorities of characters , calculate simultaneously!?

so there more perfect way calculating expression?! ..

thanks,

are writing calculator? @ reverse polish notation algorithm (that might you). can use third-party library or dynamic language (javascript engine/groovy/beanshell/google: java calculator library/etc.)


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -