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
-1
votes
1 answer

In Java, how do I write a recursive method that checks whether or not a B-Tree is binary (every child node has no more than 2 children)?

This is what I tried, but it always returns false. Maybe my B-Tree is bad, but how do I solve this? Both of these methods are in the BTree class, therefore root is the starting node. I assumed that it is not necessary to check whether or not any…
grecode97
  • 15
  • 2
-1
votes
1 answer

How to delete a key from a B+ Tree such that this key exist in an internal node and has another copy from it in a leaf node?

All the online tutorials said that you shall delete the copy in the leaf node then make the other copy in the internal node = (the successor of that key) , my question is that what guarantees for us that this successor wasn't existing in an internal…
Hossam
  • 7
  • 5
-1
votes
1 answer

Check how many nodes in a B-Tree are size n

Given a B-Tree, I have to look for all the nodes that are length n. However, I'm struggling to traverse with B-trees of a height greater than 1. I'm not sure how I can make my recursive call or my loop move such that I can reach the nodes at a lower…
hii
  • 11
  • 5
-1
votes
1 answer

Tree data structure

A b tree is a generalized binary tree . How ?
-1
votes
1 answer

A pointer error occurred during B tree implementation, but if you erase that part, a pointer error does not occur, what is the problem?

#include #include #include #include using namespace std; typedef struct BTNode { int n, *K, *A; struct BTNode **P; } BTNode; BTNode *getBTNode(int m){ BTNode* node =…
-1
votes
1 answer

In accordance with Missy Elliott's song Work It, what data structures can be both flipped AND reversed?

In Missy Elliott's song Work It, she sings, "I put my thang down, flip it, and reverse it." A lot of jokes have been made of these lyrics, including this classic xkcd: https://xkcd.com/153/ I recently saw this tweet,…
Adam
  • 959
  • 10
  • 23
-1
votes
1 answer

OutOfMemoryError when trying to add elements from a B+Tree to an ArrayList

I'm attempting to traverse through a B+ Tree and add the elements from the leaves into an ArrayList with the following code: public void toArrayList(Node node){ Node currentNode = node; if(currentNode instanceof InnerNode){ …
K091916
  • 9
  • 2
-1
votes
1 answer

template b-tree c++ implementation

I am trying to code a template class for b-tree in c++ so it can work with any type char or integer, and i faced this error when i am trying to insert to the tree, in the line 49 , 76 , and 12 so if anyone can help code is below check it out, the…
-1
votes
1 answer

What is the correct and standard way to insert item using B+ tree?

The problem is there is a lots of differences answer of b+ tree, due to their different b+ tree algorithms. I have found some different b+ tree insertion algorithms from internet. shown in below. Algorithm 1…
Novice
  • 19
  • 1
  • 8
-1
votes
1 answer

Which data structure should I use to store large 10,000 data set and do fastest search ,and take least memory?

*Suppose I have 10,000 circle(x,y,r) values , and i want to find a point (p1,p2) lies in which circle , to get fastest response for this query what data structure should i use to store those 10,000 circle data. It is a static data ,means one time…
SK17
  • 182
  • 4
  • 15
-1
votes
1 answer

How to load a B+ tree index file to memory if it doesn’t already exist?

As shown in the figure,C1–0 is’t in memory,C1 in memory, but not record C1–0 physical address,should I record it in C1? figure
cholf
  • 9
  • 4
-1
votes
1 answer

MySQL calculate RAM B+Tree's footprint for a single table (comparison with python data-struct)

I have the below data that I am caching in Python now: id timestamp data-string The data-string size is ~87 bytes. Storing this optimally in python (using dict and having the timestamp pre-pended to the data-str with delimiter), the RAM costing…
Ethan
  • 4,915
  • 1
  • 28
  • 36
-1
votes
1 answer

How many B/B+ tree will be created if I add a multi column index?

In mysql with InnoDB storage engine, When create a multi column index, such as (a, b, c), how many B+ tree/B tree will be create? Explain the detail if you can.
FisherMartyn
  • 826
  • 1
  • 8
  • 17
-1
votes
1 answer

Representing a B Tree in secondary storage

I am writing a program to store and retrieve information from a B-Tree on disk that contains strings as keys and I am having trouble finding a way to represent the tree on disk. I thought of storing every node of the B-Tree as a .bin file on disk…
physio
  • 109
  • 1
  • 13
-1
votes
1 answer

Binary Index tree in java

I'm learning how to implement a binary index tree. How should I go about building a Binary tree with a set of Strings as my input? I believe there are two data structures 1) regular Binary tree - where we do inorder postorder 2) Binary index…
shockwave
  • 3,074
  • 9
  • 35
  • 60