设为首页 加入收藏

TOP

经过自动压力测试的红黑树(删除功能完备)(五)
2014-11-24 00:11:55 来源: 作者: 【 】 浏览:87
Tags:经过 自动 压力 测试 删除 功能 完备
node->root));

mid_print (node->root,0);

printf("\n");

}

}

*/

while(1)

{

// printf("into insert mode\n");

while( node->size< COUNT)

{

i=rand()%RAND;

insert (node ,i);

count=check(node->root);

if(count)

{

// printf("\ncheck error\n");

mid_print(node->root,0);

return ;

}

count=mid_print (node->root,0);

if(count!=node->size)

{

// printf("\n %d %d \n",count ,node->size);

return ;

}

if(error_label)

{

return ;

}

if(node->size==COUNT*2/3)

{

printf("%d %d \n",node->size,depth (node->root));

}

}

// printf("into delete mode\n");

while( node->size> COUNT/2)

{

i=rand()%RAND;

delete (node ,i);

count=check(node->root);

if(count)

{

// printf("\ncheck error\n");

return ;

}

count=mid_print (node->root,0);

if(count!=node->size)

{

// printf("\n delete error %d %d \n",count ,node->size);

return ;

}

if(error_label)

{

return ;

}

if(node->size==COUNT*2/3)

{

printf("%d %d \n",node->size,depth (node->root));

}

}

}

return 0;

}

摘自 chenbingchenbing的专栏

首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇CString出错 _free_dbg(p, _NORMA.. 下一篇关于拷贝(复制)构造函数为什么..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: