我正在尝试从伪代码实现 b-tree,这里是关于 b-tree 的一些解释:
http://cs.utsa.edu/~dj/ut/utsa/cs3343/lecture17.html http://www.di.ufpb.br/lucidio/Btrees.pdf http://homepages.ius.edu/RWISMAN /C455/html/notes/Chapter18/BT-Basics.htm
所以我想用python实现代码,但只有一件事我不清楚,这段代码中“t”的目的是什么:
def bTreeInsert(T, k): #k is the key
r = T.root #r - root node
if r.n == 2*t - 1: #t = ???
s = AlocateNode()
T.root = s
s.leaf = False
s.n = 0
s.c[1] = r
bTreeSplitChildren(s, 1)
bTreeInsertNonfull(s, k)
else:
bTreeInsertNonfull(r, l)
有任何想法吗?