예제 #1
0
 void RBTree :: inorderTreeWalk( NodePtr x )
 {
    if ( x != nil ) {
       inorderTreeWalk( x->left ) ;
       cout << x->key << " " ;
       inorderTreeWalk( x->right ) ;
    }
 }
예제 #2
0
파일: bst.cpp 프로젝트: taninme/Agorithms
void BST :: inorderTreeWalk( NodePtr x )
{
    if(x != NIL)
    {
        inorderTreeWalk(x->left);
        cout<<x->key<<" ";
        inorderTreeWalk(x->right);
    }

   // You write this - it should print x->key (and a space) using cout
}
예제 #3
0
 /* Just prints tree in order as a horizontal list; may be used for debugging */
 void RBTree :: PrintTree()
 {
    cout << "Tree elements in order:\n" ;
    inorderTreeWalk( root ) ;
    cout << "\n\n" ;
 }