Enter your search keyword(s):

Click to search our directories-AllWebHunt, Encyclopedic, TopChoice, Or Google, Alexa, About & Yahoo:

 

Untitled Document
Websites

Arts
Movies, Television, Music...

Business
Jobs, Industries, Investing...

Computers
Internet, Software, Hardware...

Games
Video Games, Role playing, Gambling...

Health
Fitness, Medicine, Alternative...

Home
Family, Consumers, Cooking...

Kids & Teens
Arts, School Time, Teen Life...

News
Media, Newspapers, Weather...

Recreation
Travel, Food, Humor...

Reference
Maps, Education, Libraries...

Science
Biology, Psychology, Physics...

Shopping
Autos, Clothing, Gifts...

Society
People, Religion, Issues...

Sports
Baseball, Soccer, Basketball...

Travel
Cruises, Destinations, Reservations...


Country directories
United States, United Kingdom, Europe...


Translated directories
Deutsch, Español, Français...


Articles

Nature

Astronomy, Biology, Chemistry, Earth science, Ecology, Geography, Physics

Society
Anthropology, Archaeology, Business, Communication, Economics, Government, History, Law, Linguistics, Politics, Psychology, Public affairs, Sociology, State

Technology
Agriculture, Architecture, Engineering, Internet, Transport, Vehicles

Abstraction
Computer science, Logic, Mathematics, Philosophy, Statistics

Culture
Arts and crafts, Dance, Entertainment, Films, Fine arts, Games, Hobbies, Humor, Language, Literature, Media, Music, Recreation, Religion, Sports, Television, Visual arts and design

Human
Education, Family, Food, Health, Housing, Medicine, Personal life

Edit | Discuss Article

B-tree

B-trees are tree data structures that are most commonly found in databases and filesystem implementations. B-trees keep data sorted and allow amortized logarithmic time insertions and deletions. Conceptually speaking B-trees grow from the bottom up as elements are inserted, whereas most binary trees generally grow down.

The idea behind B-trees is that inner nodes can have a variable number of child nodes within some pre-defined range. This causes B-trees to not need re-balancing frequently, unlike AVL trees. The lower and upper bounds on the number of child nodes are fixed for a particular implementation. For example, in a 2-3 B-tree (often simply 2-3 tree), each internal node may have only 2 or 3 child nodes. A node is considered to be in an illegal state if it has an invalid number of child nodes.

The "B" stands for "balanced" because all the leaf nodes appear at the same level in the tree.

See also AVL tree, binary tree, binary space partitioning, red-black tree, skip list.

Table of contents
1 Inner node structures
2 Steps for deletion
3 Steps for insertion
4 Searching
5 Notes
6 References
7 External links

Inner node structures

Generally speaking, the "separation values" can simply be the values of the tree.

Each inner node has separation values which divide its sub-trees. For example, if an inner node has three child nodes (or sub-trees) then it must have two separation values a1 and a2. All values less than a1 will be in the leftmost sub-tree, values between a1 and a2 will be in the middle sub-tree, and values greater than a2 will be in the rightmost sub-tree.

Steps for deletion

  1. If after removing the desired node, no inner node is in an illegal state then the process is finished.
  2. If some inner node is in an illegal state then there are two possible cases:
    1. Its sibling node (a child of the same parent node) can transfer one of its child nodes to the current node and return it to a legal state. If so, after updating the separation values in the parent and the two siblings the operation ends.
    2. Its sibling does not have an extra child because it is on the lower bound too. In that case both these nodes are merged into a single node and the action is transferred to the parent node, since it has had a child node removed.

The process continues until the parent node remains in a legal state or until the root node is reached.

Steps for insertion

  1. If after inserting the node into the appropriate position, no inner node is in an illegal state then the process is finished.
  2. If some node has more than the maximum amount of child nodes then it is split into two nodes, each with the minimum amount of child nodes. This process continues action recursively in the parent node.

The action stops when either the node is in a legal state or the root is split into two nodes and a new root is inserted.

Searching

Searching is performed very similar to a binary tree search, simply by following the separation values until the value is found or the end of the tree is reached.

Notes

Suppose L is the least number of children a node is allowed to have, while U is the most number. Then each node will always have between L and U children, inclusively, with one exception: the root node may have anywhere from 2 to U children inclusively, or in other words, it is exempt from the lower bound restriction, instead having a lower bound of its own (2). This allows the tree to hold small numbers of elements. The root having one child makes no sense, since the subtree attached to that child could simply be attached to the root. Giving the root no children is also unnecessary, since a tree with no elements is typically represented as having no root node.

Robert Tarjan proved that the amortized number of splits/merges is 2.

References

Original papers:
  • Rudolf Bayer, Binary B-Trees for Virtual Memory, ACM-SIGFIDET Workshop 1971, San Diego, California, Session 5B, p. 219-235.
  • Rudolf Bayer and McCreight, E. M Organization and Maintenance of Large Ordered Indexes. Acta Informatica 1, 173-189, 1972.
Summary:
  • Donald E. Knuth, "The Art of Computer Programming", second edition, volume 3, section 6.2.4, 1997.

External links


Source | Copyright

Related categories
Webmasters: Add your website here:


Help build the largest human-edited directory on the web.
 Submit a Site - Open Directory Project (modified) - Become an Editor

Modified contents copyright 2010. All rights reserved.