Geek Articles

Categories

 

Subscribe

Daily Updates Subscribe geekarticles update via email Subscribe geekarticles update via RSS

 
GeekArticles Programming C++

Open Source C++ B+ Tree Implementation

Author: scalingweb.com | Published: 12th Jun 2008 | Visited: 1177 times | Add Comment
Filed in: CPlusPlus

Template based B+ Tree B+ Tree is a type of tree, which represents sorted data in a way that allows for efficient insertion, retrieval and removal of records, each of which is identified by a key. It is a dynamic, multilevel index, with maximum and minimum bounds on the number of keys in each index segment (usually called a 'block' or 'node'). In a B+ tree, in contrast to a B-tree, all records are stored at the lowest level of the tree; only keys are stored in interior blocks. For theory which lies behind implementation please refer to: http://en.wikipedia.org/wiki/B+_tree http://en.wikipedia.org/wiki/B-tree Notes on implementation This project goal was to create simple and yet very efficient template based B+ Tree implementation which supports different types of storage. Implemented in C++, B+ Tree is template based, so it can be used with any type of data. To change storage type (e.g. from file based to memory based) all you need is to change template argument of the BTreeAlgorithms class. There are two controllers exist for such purpose: StreamBTreeController and RamBTreeController. You can write your own controller by simply changing logic in couple of methods within exiting controllers. Two search methods available in the btree implementation: First method is performed in the typical manner, starting at the root, the tree is traversed top to bottom, choosing the child pointer whose separation values are on either side of the value that is being searched. Second method is more sophisticated and flexible. Different parameters of search can be set up by user, including starting point and method which will test each next new value. For example, using this type of search user can make efficient wildcard search on a string based btree, by simply writing wildcard test function and performing search in the btree. The btree supports iteration through class BTreeIterator and data retrieval through class BTreeContainer which can be customized as STL based or some user defined data structure based one. Several examples of using B+ Tree are provided.

Read Article
 

Sponsored Links

 


Related Articles

 Microsoft on Open XML SDK A few months ago Microsoft was able to obtain control of Open XML. Because of that achievement the company fervently worked on developing Open XML not only for their own advantage but also for other developers. Among those movements is the release of Open XML SDK which will help developers in buildi ...

 Fast LZW Compression Using Binary Tree Fast LZW implementation using Binary Tree as a dictio ...

 Simple, and Clean .NET Design and Implementation Method - Part 1 A fast and simple way in application design patterns - Pa ...

 Android Mobility: Open Source Hits the Road Learn to leverage Android's powerful APIs to rapidly create sophisticated applications for media, data storage, and network ...

 Source code generator for any data type How to extend Visual Studio so it can generate code for any data ...

 Article :: Imagining an Open Network David Chisnall examines what an open network would look like and how one could be bu ...

 Customizable Tree Control with Animation Support A tree control implementation, allowing complete customization and animation supp ...

 Video: Sun's Open-Source Application Server--GlassFish Discover the latest Java EE technology with Sun's open-source application server called GlassFish. Learn more about the communities, projects, and resources availab ...



Next: C++ Coding Practices Guide



Post Comment

Name:


Email:
 (Optional. Used for Notification)

Title:

 
Comment:


Validation Code:
 <=>  (Enter this code in text box)





Latest Articles

 

Popular Articles

Sponsored Links