OpenGenus/cosmos

Specify ascending/descending property for comparison based sorts

Open

#5,881 建立於 2020年8月14日

在 GitHub 查看
 (4 留言) (0 反應) (2 負責人)C++ (3,724 fork)batch import
Hacktoberfest

倉庫指標

Star
 (13,462 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南