Return to App by Caleb Evans

B-Sketcher Instructions


B-Sketcher is a tool for generating static B-trees. This means that you are still responsible for knowing how to properly add keys to a B-tree / this tool merely aids in drawing the B-trees you create.

Defining the tree

To draw a B-tree with this tool, you must first define it. To begin, choose whether this tree is a B-Tree or a B+ Tree via the respective dropdown menu. Then, enter the value of m (number of pointers per node) for the tree you wish to draw. Finally, you must provide the description of the tree in the following format:

  1. Rows in the tree are separated by blank lines
  2. Nodes on the same row are separated by forward slashes
  3. Keys are represented as integers
  4. Keys on the same node are separated by commas

B-Sketcher will intelligently calculate where each node points, and will highlight any incorrectly-placed keys in red, bold font.

B-tree example (m = 4)

8, 20, 22 / 28, 55
2 / 15 / 21 / 23, 24, 25 / 27 / 51 / 71, 80

B+ tree example (m = 3)

3 / 7, 8
1, 3 / 5 / 6, 7 / 8 / 9, 12

Drawing the tree

Once you've set m and you've correctly entered your tree description, press the Draw button to draw the tree. You can also press command-enter or ctrl-enter while an input field is focused to draw the tree.