C
cainiaodelixiang
Hi:
I want to define an object as the node of a tree. Unforunately i
find myself fall into the syntax maze. Could anybody please help me
out?
Here is my wrong code. I don't know how to compile it correctly.
Thank you for your help.
#include <set>
using namespace std;
struct NodeKeyCompare {
bool operator () (const Node *n1, const Node *n2)
{
return n1->m_SearchKey < n2->m_SearchKey;
}
};
typedef set<Node *, NodeKeyCompare> NodeSet;
class Node {
private:
int m_i4Depth;
NodeSet m_Children;
public:
string m_SearchKey;
};
int main()
{
return 0;
}
I want to define an object as the node of a tree. Unforunately i
find myself fall into the syntax maze. Could anybody please help me
out?
Here is my wrong code. I don't know how to compile it correctly.
Thank you for your help.
#include <set>
using namespace std;
struct NodeKeyCompare {
bool operator () (const Node *n1, const Node *n2)
{
return n1->m_SearchKey < n2->m_SearchKey;
}
};
typedef set<Node *, NodeKeyCompare> NodeSet;
class Node {
private:
int m_i4Depth;
NodeSet m_Children;
public:
string m_SearchKey;
};
int main()
{
return 0;
}