-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added B-Tree Data Structure #95
Conversation
Thanks again for being willing to contribute! I will review this PR as soon as I am available. Happy New Year :) |
Hey, I noticed a bug in the |
Okay, looks like the bug is resolved. I also made the tests a bit more random and extreme, and its all passing now. |
The base case on the [TestMethod]
public void EnumeratorTest()
{
BTree<int> tree = new(8);
foreach (int item in tree)
{
Assert.Fail();
}
} I can fix that myself but if you want to fix it before I have time go for it. Also, I would like to add an entry on the readme for BTree. That can be added in a future PR, but if you want to include it here that is fine too. |
Yes, you are right it should be |
Alright, I made mention of B-Tree in the Readme. Feel free to correct my grammar or sentences if needed. |
style changes interfacing global usings
I made some changes:
So only one actual bug fix. The rest of the changes was mainly to have it more closely follow the patterns/styles of the other code in Towel. A BTree is a 1-Dimensonal sorted tree like Red-Black trees or AVL Trees, so I was trying to get it to look more like those. I still want to review it a bit more before merging it in. |
No issues so far. I just think that the tree could have an Apart from that, it looks good enough to me. |
My plan was to have Even though the current code does not throw an exception, there could be more exceptions added to detect a corrupted tree (such as due to multi-threading). The Red-Black tree in Towel throws a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should mention that "..50 is no longer in the tree" instead of 20 in the readme for the last remove statement
Readme fixed. I haven't had a lot of time to review the actual algorithm of the B-Tree, but the unit tests you made are passing, so it looks like its in a pretty good spot. This pull request looks ready to complete to me. I wouldn't be surprised if I introduced a bug in my changes, but any bugs can be ironed out in future changes/pull-requests. :) |
Description: Added the following files
Add()
,Remove()
andSearch()
methods. All are passing.Also changed the file
setting.json
to not force/override the users' current color schemeRelated Issue: #34