Update ExpressionTree.cpp

Optimized isEquivalentTreeNode function