Skip to content

Files

Latest commit

author
Shuo
Nov 27, 2021
cb30580 · Nov 27, 2021

History

History
42 lines (33 loc) · 1.57 KB

File metadata and controls

42 lines (33 loc) · 1.57 KB

< Previous                  Next >

Related Topics

[Math] [Stack] [Tree] [Design] [Binary Tree]

Hints

Hint 1 Apply the concept of Polymorphism to get a good design
Hint 2 Implement the Node class using NumericNode and OperatorNode classes.
Hint 3 NumericNode only maintains the value and evaluate returns this value.
Hint 4 OperatorNode Maintains the left and right nodes representing the left and right operands, and the evaluate function applies the operator to them.