msambol / dsa

Data structures and algorithms in X minutes. Code examples from my YouTube channel.
https://youtube.com/michaelsambol
MIT License
434 stars 98 forks source link

[test] add Btree test and bug fix #5

Closed JIACHENG135 closed 1 year ago

JIACHENG135 commented 1 year ago

test_huge_insert_and_delete is still failing. Can you help have a look?

JIACHENG135 commented 1 year ago

pytest --log-cli-level=DEBUG ./trees/b_tree_test.py to trigger the test

msambol commented 1 year ago

Will take a look in the morning 👍🏼

JIACHENG135 commented 1 year ago

Fixed the bugs and passed all the tests.

msambol commented 1 year ago

@JIACHENG135 Hey! I appreciate you digging in. This is a fairly big shift in logic and introduces recursion. I'd like to keep the code as close as possible to the videos. Is there a bug you found that can be fixed with less logic change?

JIACHENG135 commented 1 year ago

Hey, this is not a huge change since before bug fix the recursive function is already there(which is align with your great video content). I just added the return value for delete_predecessor and delete_successorsince delete_internal_node does need that right?

JIACHENG135 commented 1 year ago

https://github.com/JIACHENG135/Btree

msambol commented 1 year ago

https://github.com/JIACHENG135/Btree

This looks great!