Questions tagged [b-tree]

B-trees are a type of self balancing search tree where each node can hold multiple keys and all leaf nodes are the same distance from the root.

B-trees are an extension of self-balancing binary search trees to allow each node to hold multiple keys and have multiple children. They are designed to take advantage of systems that can read and write in large blocks, and are commonly used in databases and file systems.

B-trees on Wikipedia

762 questions
14
votes
2 answers

Difference between B-Trees and 2-3-4 Trees

What is the difference between B-Trees and 2-3-4 Trees? Also, how would you find the maximum and minimum height of each?
zorgo
  • 183
  • 3
  • 3
  • 6
14
votes
2 answers

How to implement B+ tree in Haskell?

A B+ tree has the leaf nodes linked together. Viewing the pointer structure of a B+ tree as directed graph its not cyclic. But ignoring the directions of pointers and viewing it as undirected the leaf nodes linked together creates cycles in the…
user782220
  • 10,677
  • 21
  • 72
  • 135
13
votes
4 answers

Lightweight B-tree library for Java?

Can anyone recommend a lightweight, fast, and hopefully stable B-tree (or similar) library for Java? Essentially I'm looking for an on-disk map; something along the lines of BerkeleyDB JE, except I don't need transactions, am fine with read-only…
Dmitri
  • 8,999
  • 5
  • 36
  • 43
13
votes
2 answers

Are there any B-tree programs or sites that show visually how a B-tree works

I found this website that lets you insert and delete items from a B-tree and shows you visually what the B-tree looks like: java b-tree I'm looking for another website or program similar to this. This site does not allow you to specify a B-tree of…
neuromancer
  • 53,769
  • 78
  • 166
  • 223
13
votes
6 answers

Java On-Memory Efficient Key-Value Store

I have store 111 million key-value pairs (one key can have multiple values - maximum 2/3) whose key are 50 bit Integers and values are 32 bit (maximum) Integers. Now, my requirements are: Fast Insertion of (Key, Value) pair [allowing…
Arpssss
  • 3,850
  • 6
  • 36
  • 80
12
votes
3 answers

How can a B-tree node be represented?

We're learning B-trees in class and have been asked to implement them in code. The teacher has left choice of programming language to us and I want to try and do it in C#. My problem is that the following structure is illegal in C#, unsafe struct…
chronodekar
  • 2,616
  • 6
  • 31
  • 36
12
votes
1 answer

B+ Tree split bug

I want to be up front so I will say this homework that I am about to talk about. We are suppose to do a B+ tree. I've got it most of the way there but I am having a problem when I have a node split. Specifically when the node is a non-leaf…
Pinsickle
  • 623
  • 2
  • 10
  • 20
12
votes
2 answers

What are the advantages of T-trees over B+/-trees?

I have explored the definitions of T-trees and B-/B+ trees. From papers on the web I understand that B-trees perform better in hierarchical memory, such as disk drives and cached memory. What I can not understand is why T-trees were/are used even…
simeonz
  • 412
  • 5
  • 14
12
votes
2 answers

B-Tree - Why can't there be a node with an even number of keys?

I'm trying to implement a B-Tree according to the chapter "B-Trees" in "Introduction to Algorithms". What I don't quite get is the "minimal degree". In the book it is stated that the degree is a number which expresses the lower/upper bound for the…
helpermethod
  • 59,493
  • 71
  • 188
  • 276
12
votes
3 answers

Do DB indexes take same amount of disc space as column data?

If I have a table column with data and create an index on this column, will the index take same amount of disc space as the column itself? I'm interested because I'm trying to understand if b-trees actually keep copies of column data in leaf nodes…
Valentin V
  • 24,971
  • 33
  • 103
  • 152
11
votes
6 answers

Programming in the era of SSD

I am wondering how the oncoming SSD technology affects (mosty system) programming. Tons of questions arise, but here are some most obvious ones: Can the speed of disk access be considered anywhere near to the memory speed? If not, is it either just…
lollo
  • 139
  • 1
  • 5
11
votes
2 answers

What are the differences between B-tree and B*-tree, except the requirement for fullness?

I know about this question, but it's about B-tree and B+-tree. Sorry, if there's similar for B*-tree, but I couldn't find such. So, what is the difference between these two trees? The wikipedia article about B*-trees is very short. The only…
Kiril Kirov
  • 37,467
  • 22
  • 115
  • 187
10
votes
1 answer

How to get the maximum and minimum value of an ordered set / ordered map?

Rust's ordered set is a BTreeSet: use std::collections::BTreeSet; // Type inference lets us omit an explicit type signature (which // would be `BTreeSet<&str>` in this example). let mut books = BTreeSet::new(); // Add some books. books.insert("A…
Jeremy Cochoy
  • 2,480
  • 2
  • 24
  • 39
10
votes
2 answers

B+ tree or B-tree

I am learning about postgresql internals and I am wondering or postgresql B-tree index is actually classic B-tree or B+tree? To spell it out, that means the nodes contain only keys or key-value pairs?
Borys
  • 2,676
  • 2
  • 24
  • 37
10
votes
3 answers

C/C++: How to store data in a file in B tree

It appears to me that one way of storing data in a B-tree as a file can be done efficiently with C using binary file with a sequence (array) of structs, with each struct representing a node. One can thus connect the individual nodes with approach…
user203405
  • 201
  • 1
  • 3
  • 9
1 2
3
50 51