Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Build a Simple B-Tree | Indexing and Search Structures
Data Structures and Algorithms for Scalable Systems

bookChallenge: Build a Simple B-Tree

Oppgave

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

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 4
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Build a Simple B-Tree

Sveip for å vise menyen

Oppgave

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 desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 4
single

single

some-alt