Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

B-tree class in C# standard libraries? [closed]

Tags:

c#

tree

What class in the C# (.NET or Mono) base class libraries directly implements B-trees or can be quickly overridden/inherited to implement B-trees? I see the Hashtable class but can't seem to find any classes for anything from the Tree family...

There must be a base Tree class that can be overridden to generate specific Tree implementations (like B-tree or Red-Black or Binary Tree etc by specifying the tree invariant conditions). Doesn't make sense to have programmers reinvent the wheel for basic data structures (Tree's are pretty basic in CompSci), especially in an object oriented language; so I'm pretty sure I'm just not searching right...

Edit:

  1. I'm not using Hashtable nor do I think it's related to a Tree. I merely used it as an example of "another data structure class in the BCL".
  2. For those curious about the background aka the use case. It's for O(log(N)) searches for an in-memory associative set. Imagine creating an index for that associative set...
like image 241
DeepSpace101 Avatar asked Jan 03 '14 18:01

DeepSpace101


People also ask

What is B-tree in C?

Also, you will find working examples of search operation on a B-tree in C, C++, Java and Python. B-tree is a special type of self-balancing search tree in which each node can contain more than one key and can have more than two children. It is a generalized form of the binary search tree.

What is B-tree example?

Example of B-TreeThis supports basic operations like searching, insertion, deletion. In each node, the item will be sorted. The element at position i has child before and after it. So children sored before will hold smaller values, and children present at right will hold bigger values.

What is B-tree format?

In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing for nodes with more than two children.

Is B-tree and B+ tree same?

A B+ tree is similar to a B-tree, the only difference is that their leaves are linked at the bottom. Unlike B-tree, the nodes of the B+ tree do not store keys along with the pointers to the disk block. The internal nodes contain only keys and the leaf nodes contain the keys along with the data pointers.


1 Answers

There is no (public) implementation of a B-Tree in .NET.

There is no generic Tree class exposed that provides a partial implementation of a tree based structure.

You would need to write something like this from scratch, or use a 3rd party implementation rather than a .NET implementation.

like image 188
Servy Avatar answered Oct 04 '22 22:10

Servy