13

I found this website that lets you insert and delete items from a B-tree and shows you visually what the B-tree looks like:

java b-tree

I'm looking for another website or program similar to this. This site does not allow you to specify a B-tree of order 4 (4 pointers and 3 elements), it only lets you specify B-trees with an even number of elements. Also, if possible, I'd like to be able to insert letters instead of numbers.

I think I actually found a different site but that was a while ago and can't find it anymore.

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
neuromancer
  • 53,769
  • 78
  • 166
  • 223

2 Answers2

13

This is a great site, http://www.cs.usfca.edu/~galles/visualization/Algorithms.html

Has both interactive B and B+ Trees,

http://www.cs.usfca.edu/~galles/visualization/BTree.html http://www.cs.usfca.edu/~galles/visualization/BPlusTree.html

RBT
  • 24,161
  • 21
  • 159
  • 240
Ian McCloy
  • 306
  • 3
  • 2
  • Best of all the recommendations here. Should be the accepted answer. – RBT Dec 30 '17 at 00:41
  • 1
    This B+Tree visualization doesn't correctly take into account the scenario when a key delete from a leaf node results in minimum allowed keys. This one take it into account: https://goneill.co.nz/btree-demo.php – Eido95 Jun 20 '21 at 14:40
10

I implemented the B-tree described in CLRS in JavaScript: http://ysangkok.github.io/js-clrs-btree/btree.html

To get started, press "init simple". Then place your cursor in the input field just before the insert button. Now enter a number which isn't in the tree and press enter. Focus remains in the field so that you can insert multiple entries quickly. If you push "delete", this will be the action triggered when you push enter.

Suggestions very welcome.

Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196