treenode - B+Tree implementation, confusion about class pointers in C++ -
i have code
implementation of b+tree
project , have trouble.
there 2 classes
, 1 leaf
, saves data, , class
named node
(contains data , pointers
leafs). classes
contain more members
, prev*
, next*
, on... methods
.
to keep simple:
node { values[]; leaf*[]; }; leaf { values[]; };
problem is, nodes
can save pointers
leafs, want can save pointers
nodes
(for above layer). if leafs full, has split up. insert value
in above node
. if node
full, splits up, , if no parent node
, creates one. , on. splits can propagate through full tree.
is there easy way around this? having class
can handle different types of array pointers
in multiple instances? have use templetes , polymorphism?
Comments
Post a Comment