Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Build a Simple B-Tree | Indexing and Search Structures
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Data Structures and Algorithms for Scalable Systems

bookChallenge: Build a Simple B-Tree

Uppgift

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 True if the key is present in the B-Tree.
  • Returns False if the key is not found.

Additional Rules:

  • The minimum degree t determines 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.

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 4
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

close

bookChallenge: Build a Simple B-Tree

Svep för att visa menyn

Uppgift

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 True if the key is present in the B-Tree.
  • Returns False if the key is not found.

Additional Rules:

  • The minimum degree t determines 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.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 4
single

single

some-alt