我需要B树的插入函数源 [英] I need insert function source for B-tree
本文介绍了我需要B树的插入函数源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此结构可构建B树.
This structure build a B-tree.
struct node
{
int data[2];
node *left;
node *middle;
node *right;
node();
}*first;
node::node
{
data[0]=data[1]=-1; //Values must be even
}
int main()
{
first=NULL;
.
.
.
return 0;
}
请帮助我创建插入函数
please help me to create insert function
推荐答案
好吧,我们不会给您代码".但是,我们可以给您一些提示.例如,您可以查看 Wikipedia B树页面 [ 请注意,您编写的代码无法编译(您知道构造函数与其他方法一样,在其主体之前需要花括号).
Well, we won''t give you ''the code''. However we can give you some hints. For instance you may have a look ath the Wikipedia B-Tree page[^] where the insertion algorithm is explained (there''s even a ''pictorial'' description).
Please note, the code you wrote doesn''t compile (you know the constructor, like other methods, needs a couple of braces, before its body).
这篇关于我需要B树的插入函数源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文