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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -