- Notifications
You must be signed in to change notification settings - Fork25
Added Tree Sort#14
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
abranhe left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hi,@Pratham1807 thanks for contributing toThe All ▲lgorithms project, the huge collection of algorithms implemented in different languages.
Before merging the pull request you will need to review thecontributing guide because there are changes must be done.
├── allalgorithms│ │── sorting| | │── bubble_sort.py| | └── merge_sort.py│ └── searches| │── binary_search.py| └── linear_search.py├── docs│ │── sorting| | │── bubble-sort.md| | └── merge-sort.md│ └── searches| │── binary-search.md| └── linear-search.md└── tests │── test_searches.py └── test_sorting.pyThe above styleis required so you may need to add the algorithm along thetests anddocumentation
tests/test_sorting.py Outdated
| self.assertEqual([-44,1,2,3,7,19],cocktail_shaker_sort([7,3,2,19,-44,1])) | ||
| deftree_sort(self): | ||
| self.assertEqual([-44,1,2,3,7,19],tree_sort([7,3,2,19,-44,1])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Are you comparing a tree with an array? Remember this is a library, it should be returned, not printed.
- Also for this case, we may need documentation for the
insert()function
Pratham1807 commentedOct 11, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I have modified the tree_sort.py file. It now no longer prints the values, rather it returns a list. Now I don't think there would be a need to have documentation for the insert function as the user has to just call the tree_sort function to perform the sorting. |
abranhe left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for your contribution toThe All ▲lgorithms project, the huge collection of algorithms implemented in different languages.
- ✅Tree Sort
Thanks again! and keep it in touch. Make sure you star the repository and follow me@abranhe :) if you want!
Make sure you visit@AllAlgorithms/Python
I will try to drop a new release at the end of each month with the new algorithms that people may add, so I guess your contribution would be available on versionv0.0.1 soon.
A simple test for this algorithm available atrepl.it/@abranhe/python-libtreesorth
No description provided.