The Wayback Machine - https://web.archive.org/web/20201009015022/https://github.com/keon/algorithms/pull/694
Skip to content
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

Add 2-3-4 Tree Structure Algorithms #694

Open
wants to merge 2 commits into
base: master
from

Conversation

@TseChapman
Copy link

@TseChapman TseChapman commented Aug 29, 2020

I implement the 2-3-4 Tree structure in Python. This is my first time contributing in open source, so be welcome to give me professional comment. Thank you.

This Tree structure was taught to me in C++ and now I have implemented it in Python.
The Folder included a input .txt file, where I randomly write out a tons of number, some are duplicated.

When you run the .py file, you will get result of many unsuccessful insert. This is because of duplicates key insert.

At last, you will also get 2 printed lines. One is the root node's A value. Second the result of search a random choice of number to search.
By searching the root node's A value, you should see "Tree234: search(key): Successfully find the key by searching 1 node"

Chapman Tse
Copy link
Collaborator

@goswami-rahul goswami-rahul left a comment

Hi, thanks for contributing. We don't need that tree input.txt file. You can add a small tree for testing in tests/test_tree.py. Also remove the print statements from the algorithm, you can replace those with just comments.

@TseChapman
Copy link
Author

@TseChapman TseChapman commented Oct 2, 2020

@goswami-rahul Thanks for the comment, I will change it and push it again. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.