示例#1
0
文件: c++.cpp 项目: mkut/aoj
	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);
	}
示例#2
0
文件: c++.cpp 项目: mkut/aoj
	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)) + ")";
		}
	}