b-plus-tree | A Java implementation of B tree for key-value store | Key Value Database library
kandi X-RAY | b-plus-tree Summary
kandi X-RAY | b-plus-tree Summary
A Java implementation of B+ tree for key-value store.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns a string representation of this tree
- Returns the value associated with the specified key
- Removes the association with the specified key from this tree
- Associates the specified value with the specified key
- Returns the values associated with the specified policies
b-plus-tree Key Features
b-plus-tree Examples and Code Snippets
Community Discussions
Trending Discussions on b-plus-tree
QUESTION
I'm a little confused with the deletion in B+ tree. I searched a lot in Google and find that there are two implementation when the key you want to delete appears in the index:
- Delete the key in the index
- Keep the key in the index
Algorithm from https://www.javatpoint.com/b-plus-tree-deletion uses the first way.
Algorithm from https://www.cs.princeton.edu/courses/archive/fall08/cos597A/Notes/BplusInsertDelete.pdf uses the second way.
So I really want to know which one is right.
But I'm more inclined to take that as an undefined behavior. At this point, could someone help me figure out the advantage and disadvantage between them? And how to choose between them?
Thanks in advance.
...ANSWER
Answered 2019-Aug-27 at 21:21Both methods are correct.
The difference that you highlight is not so much in deleting/not-deleting internal keys, but in updating/not-updating them.
Obviously, when you delete a value (i.e. a key in a leaf node), the b-plus-tree property is not violated: all child values are still within the range dictated by the parent information. You can never break this range-rule by merely removing a value from a leaf. This rule is also still valid when you update the internal key(s) in the path to that leaf (according to method 1), which is only necessary when the deleted value was the left-most one in its leaf.
Note that the two methods may produce quite different trees after a long sequence of the same operations (insert, delete).
But on average the second method will have slightly less work to do. This difference is not significant though.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install b-plus-tree
You can use b-plus-tree like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the b-plus-tree component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page