class Position { // a node position
public:
E& operator*(); // get element
Position parent() const; // get parent
PositionList children() const; // get node’s children
bool isRoot() const; // root node?
bool isExternal() const; // external node?
};
这是树 里面一个表示位置的类, 我不太懂的是 为什么Position parent() const; // get parent, 这句话里面成员函数 parent() 返回的类型是Position 这个类
template <typename E>一开始漏了一个这个模版的E
芜湖不芜
森林海
相关分类