Challenge: Build a Simple B-Tree
Taak
Swipe to start coding
In this challenge, you will implement a simplified B-Tree — a balanced search tree widely used in databases and file systems.
Your task is to complete the implementation so that the tree supports:
insert(key):
- Inserts a new key into the B-Tree.
- Splits nodes when they overflow to maintain B-Tree properties.
- The root must split correctly when full.
- Insertion must always place keys in sorted order.
search(key):
- Returns
Trueif the key is present in the B-Tree. - Returns
Falseif the key is not found.
Additional Rules:
- The minimum degree
tdetermines the minimum/maximum number of keys in each node. - You do not need to implement deletion or disk storage.
- The tree must correctly handle multiple insertions and node splits.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 2. Hoofdstuk 4
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Geweldig!
Completion tarief verbeterd naar 7.69
Challenge: Build a Simple B-Tree
Veeg om het menu te tonen
Taak
Swipe to start coding
In this challenge, you will implement a simplified B-Tree — a balanced search tree widely used in databases and file systems.
Your task is to complete the implementation so that the tree supports:
insert(key):
- Inserts a new key into the B-Tree.
- Splits nodes when they overflow to maintain B-Tree properties.
- The root must split correctly when full.
- Insertion must always place keys in sorted order.
search(key):
- Returns
Trueif the key is present in the B-Tree. - Returns
Falseif the key is not found.
Additional Rules:
- The minimum degree
tdetermines the minimum/maximum number of keys in each node. - You do not need to implement deletion or disk storage.
- The tree must correctly handle multiple insertions and node splits.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 2. Hoofdstuk 4
single