Showing posts with label b-tree. Show all posts
Showing posts with label b-tree. Show all posts

Wednesday, September 22, 2010

B-tree vs. binary tree

This is inspired by something that Mantas said on Tuesday, about how people he interviews should know a B-tree from a binary tree. Now, I know about binary trees but I've never heard of a B-tree, so I did some research.

To my new (but still very limited) understanding, a B-tree is a tree which can have more than two branches from a node, and more than one data point (number) in each node. B-trees are used in databases "and other places which use large data chunks." Basically, a B-tree is for searching in data which is all or mostly stored on a magnetic disk, i.e. slow retrieval.

It sounds cool. I haven't written one. I kinda want to.

Here's a nice blog about it; obviously this person understands it in more depth than I do, and uses it in practice. http://attractivechaos.wordpress.com/2008/09/24/b-tree-vs-binary-search-tree/

Here's a guy who wrote a Btree, and some code. http://resnet.uoregon.edu/~gurney_j/jmpc/btree.html

Here's the wikipedia page on it, much good may it do you. http://en.wikipedia.org/wiki/B-tree

Some more in-depth description (my favorite link) http://www.bluerwhite.org/btree/