Util.Structures
Class ReversePolish
java.lang.Object
Util.Structures.ReversePolish
public class ReversePolish
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReversePolish
public ReversePolish()
ReversePolish
public ReversePolish(java.lang.String s)
clear
public void clear()
setTokens
public void setTokens(java.lang.String s)
setTokens
public void setTokens(java.util.ArrayList<Symbol> tokens)
getTokens
public java.util.ArrayList<Symbol> getTokens()
getRoot
public BinaryNode<Symbol> getRoot()
getPostfix
public java.util.ArrayList<Symbol> getPostfix()
toPrefixPhenotype
public Phenotype toPrefixPhenotype(Phenotype phenotype)
treeFromPostfix
public void treeFromPostfix()
buildTreeFromPostfix
public BinaryNode<Symbol> buildTreeFromPostfix()
toReversePolish
public java.lang.String toReversePolish()
- The method toReversePolish converts the infix expression into a
reverse Polish string.
- Returns:
- Return the reverse Polish string.
toPrefixString
public java.lang.String toPrefixString(BinaryNode<Symbol> node)
- Traverses a binary tree depth first
- Parameters:
node
- node to travers
- Returns:
- string value of node