OpenGenus/cosmos
Ver no GitHubSpecify ascending/descending property for comparison based sorts
Open
#5.881 aberto em 14 de ago. de 2020
Hacktoberfest
Métricas do repositório
- Stars
- (13.462 stars)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
This is a(n):
- New algorithm
- Update to an existing algorithm
- Error
- Proposal to the Repository
Details:
Comparison based sorting algorithms can have two results: the object is either sorted in ascending or descending order. From what I see, most of the algorithms submitted here assume ascending order, but this can be easily resolved if an additional boolean parameter is passed to the sort function to specify the ascending/descending property. This would also entail changing the test files which depend upon the sort function accepting only the object as a parameter.