0001 template <typename T> struct BTNode; 0002 template <typename T> using BTNP = BTNode<T>*; //B-Tree Node Position 0003 template <typename T> struct BTNode { 0004 BTNP<T> parent; Rank height; //Height(nullptr) = 0,其余递推 0005 Vector<T> key; Vector<BTNP<T>> way; //关键码向量、孩子向量(后者长度总是多一个单位) 0006 BTNode(Rank b, Rank h = 1, BTNP<T> c = nullptr) //b阶 0007 : key(b), way(b+1), parent(nullptr), height(h) //初始时,无关键码 0008 { if (c) { way.insert(c); c->parent = this; } } //但可能会有个分支 0009 }; //BTNode