0
0
Data Structures Theoryknowledge~5 mins

B-trees for databases in Data Structures Theory - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a B-tree in the context of databases?
A B-tree is a balanced tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. It is widely used in databases to organize and quickly access large amounts of data stored on disk.
Click to reveal answer
intermediate
Why are B-trees preferred for database indexing over binary search trees?
B-trees are preferred because they reduce the number of disk reads by having nodes with many keys and children, which means the tree is shorter and wider. This structure minimizes slow disk access, making data retrieval faster compared to binary search trees that have many levels.
Click to reveal answer
beginner
What does it mean that a B-tree is 'balanced'?
A B-tree is balanced because all leaf nodes are at the same depth. This means every path from the root to a leaf has the same length, ensuring consistent and predictable access times for all data entries.
Click to reveal answer
intermediate
How does a B-tree handle insertions when a node is full?
When a node is full, the B-tree splits the node into two nodes and moves the middle key up to the parent node. This splitting may propagate up the tree, keeping the tree balanced and maintaining its properties.
Click to reveal answer
beginner
What is the main advantage of having multiple keys in each node of a B-tree?
Having multiple keys per node reduces the tree's height, which means fewer disk accesses are needed to find a key. This improves performance because accessing disk is slower than accessing memory.
Click to reveal answer
What property ensures that all leaf nodes in a B-tree are at the same level?
ARecursion
BBalance
CUniqueness
DOrdering
Why do B-trees have nodes with multiple keys?
ATo reduce tree height and disk reads
BTo make the tree binary
CTo store duplicate keys
DTo increase tree depth
What happens when a B-tree node becomes full during insertion?
AThe node splits and the middle key moves up
BThe node deletes the oldest key
CThe tree becomes unbalanced
DInsertion is rejected
Which of these is NOT a typical operation supported efficiently by B-trees?
ASearch
BDeletion
CSorting all keys in linear time
DInsertion
What is the main reason B-trees are used in databases?
ATo simplify programming
BTo use less memory
CTo store images
DTo minimize slow disk access
Explain how a B-tree maintains balance and why this is important for database performance.
Think about how the tree grows and stays even.
You got /4 concepts.
    Describe the advantages of using B-trees over binary search trees in database indexing.
    Focus on how data is stored and accessed on disk.
    You got /4 concepts.