12 B-TREES Flashcards
What is the primary purpose of B-trees?
To manage the cost of retrieving new blocks of data.
What is a page in the context of data retrieval?
An entire block of information read from the hard drive and stored in memory.
Who designed the B-tree data structure?
Rudolf Bayer and Edward McCreight.
What is the tradeoff of using B-trees?
Additional complexity when dealing with the nodes.
What is the size parameter ‘k’ in a B-tree?
It defines the bounds on how many elements a non-root node can store.
What is the minimum and maximum number of keys a non-root B-tree node can store?
Between k and 2k keys.
What is the maximum number of keys a root node in a B-tree can store?
Between 0 and 2k keys.
How do internal nodes in a B-tree determine the ranges for branches?
Using the values of the keys to define the ranges.
What is the balancing property of B-trees?
Every leaf node is at the same depth from the root.
How are B-tree nodes structured?
They contain keys, pointers to children, and flags for leaf status.
What analogy is used to explain the benefit of packing multiple items into a B-tree node?
Shipping costs for multiple small boxes versus packing several items into one box.
What is the role of pointers in B-trees?
To link keys to corresponding child nodes and to manage the structure.
What is the process for searching a B-tree?
Start at the root and work down, checking keys and descending to child nodes as needed.
True or False: B-trees allow only two branches per node.
False.
What is the expected runtime benefit of searching within a B-tree node?
Data accesses within a node are relatively cheap because they occur in local memory.
What happens when a B-tree node becomes overfull during insertion?
The node is split to maintain balance.
Fill in the blank: In a B-tree, internal nodes can have between _____ and _____ children.
k + 1 and 2k + 1.
What is a potential downside of storing index cards in sorted order compared to using a B-tree?
Requires cascading updates to many binders as cards must be shifted over.
What two approaches can be taken when a B-tree node is full during insertion?
- Split as we proceed down the tree
- Insert temporarily into a full node and split on the way back up.
What type of data structure is used to define B-trees?
A composite data structure with nodes and size parameters.
What is the significance of the B-tree’s multi-way branching structure?
It allows for more than two branches and maximizes data retrieval efficiency.
What occurs when searching for a key that does not exist in a B-tree?
The search returns null if the current node is a leaf.
What is the first step in the B-tree insertion algorithm?
Proceed down the tree, searching for the position to insert the new key.
What happens if a node becomes overfull during a B-tree insertion?
The node is split on the way back up the tree.