algorithmtutorprograms
algorithmtutorprograms copied to clipboard
Program Codes for AlgorithmTutor.Com
I poked around a bit and couldn't find a license statement on the code here or at the main website. Each file should have a license statement as well as...
https://github.com/Bibeknam/algorithmtutorprograms/blob/11ef340f8c8e60839a9dff395dd52b8752c537a6/data-structures/red-black-trees/RedBlackTree.cpp line 303 z is pointing to tree and is deleted Subsequent lines use the tree which is already deleted
That's not a bug, I am just curious why it is the case. ```c++ int main() { RBTree bst; for (int i = 0; i < 31; i++) { bst.insert(i);...
Your implementation has some non-pythonic way of doing things, without changing functionality this is in my opinion cleaner implementation of your idea.
https://github.com/Bibeknam/algorithmtutorprograms/blob/11ef340f8c8e60839a9dff395dd52b8752c537a6/data-structures/red-black-trees/RedBlackTree.cpp#L115 I believe it should be "s->**left**->color == 0 && s->right->color == 0"
This line if code checks only the right child colour. It should check the left child as well. https://github.com/Bibeknam/algorithmtutorprograms/blob/705130fc0c5fb5c6bdc53967aea7de644e9bb2c5/data-structures/red-black-trees/RedBlackTree.cpp#L115
Single letter variable use. Your code is extremely hard to read due to the lack of self documenting variables.
There are two print statements that should have brackets for python3 on the splay_tree
The function does not return anything. It should "return x"
don't balance after deletion