When your teacher gave you this assignment, he presumably discussed how to represent an equation as a red-blue tree, or told you you could use Reverse Polish notation, or in some other fashion limited the grammar of the equation.
Go ask him to provide these details again.
Failing that I think moritz summed it up pretty well.