Skip to content

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 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 9 commits into from
Oct 11, 2018
Merged

Added Tree Sort #14

merged 9 commits into from
Oct 11, 2018

Conversation

Pratham1807
Copy link
Contributor

No description provided.

Copy link
Owner

@abranhe abranhe left a 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 to The All ▲lgorithms project, the huge collection of algorithms implemented in different languages.

Before merging the pull request you will need to review the contributing 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.py

The above style is required so you may need to add the algorithm along the tests and documentation

@abranhe abranhe added Tests needed Test are required, so should be added Documentation needed Documentation is required, so should be added labels Oct 10, 2018
@@ -32,6 +33,9 @@ def test_stooge_sort(self):

def test_cocktail_shaker_sort(self):
self.assertEqual([-44, 1, 2, 3, 7, 19], cocktail_shaker_sort([7, 3, 2, 19, -44, 1]))

def tree_sort(self):
self.assertEqual([-44, 1, 2, 3, 7, 19], tree_sort([7, 3, 2, 19, -44, 1]))
Copy link
Owner

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

@abranhe abranhe added invalid This doesn't seem right and removed Documentation needed Documentation is required, so should be added Tests needed Test are required, so should be added labels Oct 11, 2018
@Pratham1807
Copy link
Contributor Author

Pratham1807 commented Oct 11, 2018

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 abranhe removed the invalid This doesn't seem right label Oct 11, 2018
Copy link
Owner

@abranhe abranhe left a 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 to The 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 version v0.0.1 soon.

A simple test for this algorithm available at repl.it/@abranhe/python-libtreesorth

@abranhe abranhe merged commit da7917c into abranhe:master Oct 11, 2018
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