Implementing B-Trees in Python
Lesson 1 of 2
  1. 1
    To review the conceptual article, a B-tree is a balanced search tree designed to be an efficient data structure when working on physical storage devices like disks. When storing large amounts of da…
  2. 2
    The first thing we need to do is represent B-trees and B-tree nodes as Python objects. Starting with B-tree Nodes, we have some important characteristics we need to keep in mind: - Nodes can have …
  3. 3
    You have now completed the necessary steps to represent a BTree in Python and can now move on to implementing the fundamental operations needed to leverage BTrees. We start first with an insert met…
  4. 4
    We wouldn’t need three exercises dedicated to interesting BTree values if it was as simple as adding to a single key. Now we will focus on what happens once that initial root node is filled. If t…
  5. 5
    Following exercise four, all functionality needed for a split at the node level is complete. We can now focus on implementing the logic of traversing the BTree when trying to insert, including when…
  6. 6
    Congratulations on implementing insert in your BTrees! You now can create full BTrees to your liking and implement additional yet essential operations. The first of those operations we are going t…
  7. 7
    Congratulations! You have built an entire B-Tree from scratch! To review, we have implemented the following methods in BTree and BTreeNode classes: * split() * _is_leaf() * _is_full() * add_key() …

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo