bool operator==(BinaryTree& b) { if(left.isNull() && b.left.isNull()) return true; if(left.isNull() || b.left.isNull()) return false; return (left == b.left && right == b.right) || (left == b.right && right == b.left); }
string str(bool typeL) { if(left.isNull()) return "x"; else { return "(" + (typeL == *left < *right ? (*left).str(true) : (*right).str(true)) + " " + (typeL == *left < *right ? (*right).str(false) : (*left).str(false)) + ")"; } }