I am trying to implement b-tree from pseudocode, here is some explanation about 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
So i want to implement the code in python, but only one thing is not clear for me, what is the purpose of “t” in this code:
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)
Any ideas?
tis the minimum degree of the tree, i.e. the minimum number of children each node in the tree must have (and also half of the maximum number of children each node may have).