Skip to content
Advertisement

Tag: tree

Parsing an arithmetic expression and building a tree from it in Java

I needed some help with creating custom trees given an arithmetic expression. Say, for example, you input this arithmetic expression: The result tree should look like: I have some custom classes to represent the different types of nodes, i.e. PlusOp, LeafInt, etc. I don’t need to evaluate the expression, just create the tree, so I can perform other functions on

Advertisement