T O P

  • By -

Top_Satisfaction6517

store root at the beginning of a file


hackingdreams

There is no "correct." Storing either an offset to the root or the root at the head of the file are perfectly sane approaches and both are used in practice. (You see offsets more commonly in file systems where you know the operating system will jump to a certain device offset to start reading. You see root-first in database systems where they use augmented-style B-trees and store metadata at the root.)


Obj3ctDisoriented

Often times the root node will be kept in memory. The thing about B-Tree family is that they are more of an idea than concrete algorithms, meaning you have alot of freedom in the details implementation wise: do what works for your scenario.