Reputation: 770
I am trying to implement a B+ tree. So far I have leaf node, root node, inner node classes. Inside my lead node class, I have a list for keys and a list for values. My question is that instead of having lists for values and keys, Can I have a map pairing key to value? If no, can you explain why.
Upvotes: 1
Views: 855
Reputation: 114461
Normally you would build a B+Tree from lower-level data structures.
A map is normally implemented as a Tree itself, so if you already have maps why are you implementing a B+Tree?
Even using a list is a bad fit... a B+ page should be implemented using only arrays (or even better raw bytes in which you allocate arrays).
Upvotes: 2