chapter
    File Organization, Indexing and B+ Trees Notes for GATE CS

    File Organization, Indexing and B+ Trees notes for GATE CS: 27 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questio

    file organization indexing and b trees notes

    B+ Tree Insertion, Splitting and Occupancy

    Databases › File Organization, Indexing and B+ Trees

    B+ Tree Mechanics

    Mastering insertion, splitting, and balance.

    What you will learn here
    1
    The step-by-step algorithm for inserting keys into leaf and internal nodes.
    2
    How node splitting works and how the middle key propagates upward.
    3
    Occupancy constraints: why nodes must be at least half full.

    B+ Tree Structure and Order

    B+ Tree Structure and Order

    1. The Order ()

    Defines node capacity. A node has at most child pointers and keys. Note: Verify if the problem specifies "max keys" or "max pointers".

    2. Balanced Property

    All leaf nodes are at the same depth. This guarantees consistent search time for any key.

    3. Leaf vs Internal Nodes

    Internal Nodes: Contain keys and child pointers. Act as an index.

    Leaf Nodes: Contain keys and data pointers. Linked for range queries.

    Key Insight: Because internal nodes do not store data pointers, they can hold more keys per block, reducing the tree height.

    Insertion Algorithm: Leaf Node Overflow

    Insertion: Leaf Node Overflow

    1

    Find Leaf

    Traverse the tree to find the appropriate leaf node .

    2

    Check Space

    If has keys, insert in sorted order. If full ( keys), Overflow.

    3

    Split Leaf

    Temporarily include new key in (now keys). Sort all keys.

    Left Node
    First keys
    Right Node
    Remaining keys

    Separator: Smallest key of Right Node is copied to parent.

    Crucial Rule: In B+ Trees, the separator key is copied to the parent, not moved. It remains in the leaf.

    Visualizing Leaf Split
    [10]
    [15, 20]
    15

    24 more cards in this chapter

    Free preview ends here

    Login to view the complete notes

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    File Organization, Indexing and B+ Trees Notes for GATE CS

    File Organization, Indexing and B+ Trees notes for GATE CS: 27 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    B+ Tree Insertion, Splitting and Occupancy

    Databases › File Organization, Indexing and B+ Trees

    B+ Tree Mechanics

    Mastering insertion, splitting, and balance.

    What you will learn here
    1
    The step-by-step algorithm for inserting keys into leaf and internal nodes.
    2
    How node splitting works and how the middle key propagates upward.
    3
    Occupancy constraints: why nodes must be at least half full.

    B+ Tree Structure and Order

    B+ Tree Structure and Order

    1. The Order ()

    Defines node capacity. A node has at most child pointers and keys. Note: Verify if the problem specifies "max keys" or "max pointers".

    2. Balanced Property

    All leaf nodes are at the same depth. This guarantees consistent search time for any key.

    3. Leaf vs Internal Nodes

    Internal Nodes: Contain keys and child pointers. Act as an index.

    Leaf Nodes: Contain keys and data pointers. Linked for range queries.

    Key Insight: Because internal nodes do not store data pointers, they can hold more keys per block, reducing the tree height.

    Insertion Algorithm: Leaf Node Overflow

    Insertion: Leaf Node Overflow

    1

    Find Leaf

    Traverse the tree to find the appropriate leaf node .

    2

    Check Space

    If has keys, insert in sorted order. If full ( keys), Overflow.

    3

    Split Leaf

    Temporarily include new key in (now keys). Sort all keys.

    Left Node
    First keys
    Right Node
    Remaining keys

    Separator: Smallest key of Right Node is copied to parent.

    Crucial Rule: In B+ Trees, the separator key is copied to the parent, not moved. It remains in the leaf.

    Visualizing Leaf Split
    [10]
    [15, 20]
    15

    Worked Example: Leaf Split

    Worked Example: Leaf Split

    Given

    Order: (Max 2 keys)
    Leaf :
    Insert:

    Process

    1
    Overflow: is full. Add 15 temporarily: .
    2
    Split: Left gets key . Right gets keys .
    3
    Update Parent: Copy to parent.

    Result

    Parent:
    Left Leaf:
    Right Leaf:

    More notes in this unit