<p>I am looking for a lean and well constructed open source implementation of a B-tree library written in C. It needs to be under a non-GPL license so that it can be used in a commercial application. Ideally, this library supports the B-tree index to be stored/manipulated as a disk file so that large trees can be built using a configurable (ie: minimal) RAM footprint.</p>

<p>Note: Since there seemed to be some confusion, a Binary Tree and a B-Tree are <em>not</em> the same thing.</p>

[{'answer_id': 34097, 'author': 'A. Rex', 'author_id': 3508, 'author_profile': 'https://Stackoverflow.com/users/3508', 'pm_score': 3, 'selected': False, 'text': '<p>The author of the <a href="http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/btree.c&amp;v=1.504" rel="nofollow noreferrer">SQLite implementation</a> has disclaimed copyright.  If LGPL is okay, then maybe you could use <a href="http://gnupdate.cvs.sourceforge.net/gnupdate/libpackman/modules/database/gnupdate/db/btree.c?revision=1.12&amp;view=markup" rel="nofollow noreferrer">GNUpdate\'s implementation</a>?</p>\n'}, {'answer_id': 417339, 'author': 'florin', 'author_id': 18308, 'author_profile': 'https://Stackoverflow.com/users/18308', 'pm_score': 3, 'selected': False, 'text': '<p>If LGPL is ok, then <a href="http://fallabs.com/tokyocabinet/" rel="nofollow noreferrer">Tokyo Cabinet</a> might fit the bill.  LGPL allows linking with a non-Free application, without adding any constraints on the distribution of the final product.</p>\n'}, {'answer_id': 993563, 'author': 'bill', 'author_id': 121958, 'author_profile': 'https://Stackoverflow.com/users/121958', 'pm_score': 0, 'selected': False, 'text': '<p>Maybe you can considere the berkeley db. It is using a b-tree internally.</p>\n'}, {'answer_id': 993626, 'author': 'dkretz', 'author_id': 31641, 'author_profile': 'https://Stackoverflow.com/users/31641', 'pm_score': 2, 'selected': False, 'text': '<p>I came across <a href="http://people.csail.mit.edu/jaffer/WB" rel="nofollow noreferrer">this</a> - The WB B-Tree Database for SCM, Java, C#, and C that\'s a GNU package.</p>\n'}, {'answer_id': 993735, 'author': 'Lear', 'author_id': 80223, 'author_profile': 'https://Stackoverflow.com/users/80223', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://attractivechaos.wordpress.com/programs/" rel="nofollow noreferrer">Attractive Chaos</a> implement kbtree.h. It\'s a efficient B-tree library</p>\n'}, {'answer_id': 9721453, 'author': 'Paul', 'author_id': 1271745, 'author_profile': 'https://Stackoverflow.com/users/1271745', 'pm_score': 4, 'selected': True, 'text': '<p>Check out QDBM: <a href="http://fallabs.com/qdbm/" rel="noreferrer">http://fallabs.com/qdbm/</a>.  It\'s LGPL (can be used in commercial app), implements a disk backed hash and/or B+ tree with arbitrary key/value pairs, and builds on a variety of platforms. </p>\n'}]
['https://Stackoverflow.com/questions/32376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1553/']