mydriver.cp

来自「平衡二叉树的原代码,欢迎使用和下载. 请查收」· CP 代码 · 共 43 行

CP
43
字号
#include <iostream>#include <cassert>#include "AVLTree.h"using namespace std;int i;			// used in loopsint SIZE = 10;	// number of testsint main( void){		// tree of ints	AVLTree <int> T;	vector <int> V;			// Try the random-sequence test a bunch of times.  	for( i = 0; i < SIZE; i++ )  	{    	// Insert in decreasing order.    	for( i = 0; i < SIZE; i++ )      	V.push_back( i );    	random_shuffle( V.begin(), V.end() );    	// Insert in a random order.    	for( i = 0; i < V.size(); i++ )    	{      	T.insert( V[ i ] );      	assert( T.contains( V[ i ] ) );    	}    }		// check the constraints of the tree,	//		the balances of the children	T.sanityCheck();		// print the tree to the screen	T.dump();				return 0;}

⌨️ 快捷键说明

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