⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testavltree.cpp

📁 The existed tree implementation
💻 CPP
字号:
        #include <iostream.h>        #include "AvlTree.h"            // Test program        int main( )        {            const int ITEM_NOT_FOUND = -9999;            AvlTree<int> t( ITEM_NOT_FOUND ), t2( ITEM_NOT_FOUND );            int NUMS = 40000;            const int GAP  =   37;            int i;            cout << "Checking... (no more output means success)" << endl;            for( i = GAP; i != 0; i = ( i + GAP ) % NUMS )                t.insert( i );            if( NUMS < 40 )                t.printTree( );            if( t.findMin( ) != 1 || t.findMax( ) != NUMS - 1 )                cout << "FindMin or FindMax error!" << endl;            t2 = t;            for( i = 1; i < NUMS; i++ )                if( t2.find( i ) != i )                    cout << "Find error1!" << endl;            if( t2.find( 0 ) != ITEM_NOT_FOUND )                cout << "ITEM_NOT_FOUND failed!" << endl;            return 0;    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -