添加注释

This commit is contained in:
邹晓航
2014-10-31 15:53:07 +08:00
parent 9596cb28df
commit c441b28c75
2 changed files with 3 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ namespace TinySTL{
void insert(const T& val);
template<class Iterator>
void insert(Iterator first, Iterator last);
void erase(const T& val);//todo
void erase(const T& val);
size_t height()const{ return getHeight(root_); }
size_t size()const{ return size_; }

View File

@@ -87,7 +87,7 @@ namespace TinySTL{
};//end of bst class
template<class T>
size_t binary_search_tree<T>::height_aux(node *p)const{
TinySTL::queue<node *> q, level;
TinySTL::queue<node *> q/*存放下一层的node*/, level/*存放当前层的node*/;
size_t nlevel = 0;
if (p != 0){
level.push(p);
@@ -95,7 +95,7 @@ namespace TinySTL{
while (!(q.empty() && level.empty())){
if (level.empty()){
++nlevel;
while (!q.empty()){
while (!q.empty()){//当前层为空将下一层的node全部转移至当前层
level.push(q.front());
q.pop();
}