免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12345
最近访问板块 发新帖
楼主: ldap
打印 上一主题 下一主题

BTREE算法C语言实现 [复制链接]

论坛徽章:
0
41 [报告]
发表于 2007-12-16 20:24 |只看该作者
原帖由 win_hate 于 2007-12-14 12:50 发表




我说的 BT tree 是指变态树,唯有变态,才是最好。

哦, 不過轉得很硬

论坛徽章:
0
42 [报告]
发表于 2007-12-25 07:08 |只看该作者
can you put all pieces together and write a sample test code?

论坛徽章:
0
43 [报告]
发表于 2007-12-25 11:08 |只看该作者
期待楼主的上传......

论坛徽章:
38
2017金鸡报晓
日期:2017-02-08 10:39:4215-16赛季CBA联赛之深圳
日期:2023-02-16 14:39:0220周年集字徽章-年
日期:2022-08-31 14:25:28黑曼巴
日期:2022-08-17 18:57:0919周年集字徽章-年
日期:2022-04-25 13:02:5920周年集字徽章-20	
日期:2022-03-29 11:10:4620周年集字徽章-年
日期:2022-03-14 22:35:1820周年集字徽章-周	
日期:2022-03-09 12:51:3220周年集字徽章-年
日期:2022-02-10 13:13:4420周年集字徽章-周	
日期:2022-02-03 12:09:4420周年集字徽章-20	
日期:2022-01-25 20:14:2720周年集字徽章-周	
日期:2022-01-13 15:12:33
44 [报告]
发表于 2007-12-25 15:46 |只看该作者
    /* insert middle and divide */
    if (pos == m) {
        insert_middle32_i(node, new, son, index, &index, key, &key, pos);
    }
    /* insert left and divide */
&nbsp;&nbsp;&nbsp;&nbsp;if (pos < m) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;insert_left32_i(node, new, son, index, &index, key, &key, pos);
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;/* insert right and divide */
&nbsp;&nbsp;&nbsp;&nbsp;if (pos > m) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;insert_right32_i(node, new, son, index, &index, key, &key, pos);
&nbsp;&nbsp;&nbsp;&nbsp;}


难道C语言没有else if ? 我糊涂了。

论坛徽章:
0
45 [报告]
发表于 2008-01-18 14:54 |只看该作者

if

if else if  效率肯定比判断3次效率高。我没细看。楼主能不能说明下你写的东西的优势,因为网上这种代码比较多。我也没有具体分析过。处理上亿数据,你的B TREE优势是?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP