Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Calculate ¶
func Calculate(tree *ArithmeticTree) int
Calculate takes an ArithmeticTree and returns its calculated value. Runs in O(N) in that it only views the tree nodes once.
Types ¶
type ArithmeticTree ¶
type ArithmeticTree struct {
// contains filtered or unexported fields
}
ArithmeticTree represents either a node operator or a leaf value.
Click to show internal directories.
Click to hide internal directories.