bibeknam / algorithmtutorprograms Goto Github PK
View Code? Open in Web Editor NEWProgram Codes for AlgorithmTutor.Com
Home Page: https://algorithmtutor.com
Program Codes for AlgorithmTutor.Com
Home Page: https://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 a master license at the top of the repository.
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"
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
This line if code checks only the right child colour. It should check the left child as well.
I believe it should be "s->left->color == 0 && s->right->color == 0"
Single letter variable use. Your code is extremely hard to read due to the lack of self documenting variables.
That's not a bug, I am just curious why it is the case.
int main() {
RBTree bst;
for (int i = 0; i < 31; i++) {
bst.insert(i);
}
bst.prettyPrint();
return 0;
}
produces a tree without any violations but at the other time it isn't really balanced.
R----7(BLACK)
L----3(BLACK)
| L----1(BLACK)
| | L----0(BLACK)
| | R----2(BLACK)
| R----5(BLACK)
| L----4(BLACK)
| R----6(BLACK)
R----15(RED)
L----11(BLACK)
| L----9(BLACK)
| | L----8(BLACK)
| | R----10(BLACK)
| R----13(BLACK)
| L----12(BLACK)
| R----14(BLACK)
R----19(BLACK)
L----17(BLACK)
| L----16(BLACK)
| R----18(BLACK)
R----23(RED)
L----21(BLACK)
| L----20(BLACK)
| R----22(BLACK)
R----25(BLACK)
L----24(BLACK)
R----27(RED)
L----26(BLACK)
R----29(BLACK)
L----28(RED)
R----30(RED)
I stumbled upon playing with my own implementation and just looked around for something else to compare with.
don't balance after deletion
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.