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

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -