Skip to content

AVL Trees added #31

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

Merged
merged 2 commits into from
Sep 11, 2014
Merged

AVL Trees added #31

merged 2 commits into from
Sep 11, 2014

Conversation

afernandez90
Copy link
Contributor

Hi, I added a generic AVL tree. I saw there is already an RBTree structure in the repo and uses key/value pairs. In my case, I think AVL trees are not only for dictionaries with key/value pairs. However, the same behavior can be achieved by making the elements in the AVL a key/value pair and redefining the ordering operators, just like when using an std::set.

The AVL is more balanced than a RBT but it takes a bit longer to insert/delete elements due to the rotations. So it's faster for searching but slower for the rest.

xtaci added a commit that referenced this pull request Sep 11, 2014
@xtaci xtaci merged commit 7637e26 into xtaci:master Sep 11, 2014
@xtaci
Copy link
Owner

xtaci commented Sep 11, 2014

you can add author in the comment at the beginning of the avl.h

i've tested , it works fine.

thanks

@afernandez90
Copy link
Contributor Author

thanks to you, I've just added the author to the header file. PR inc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants