Beispiel #1
0
Datei: c++.cpp Projekt: 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);
	}
Beispiel #2
0
Datei: c++.cpp Projekt: 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)) + ")";
		}
	}