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

Fix sort_ascend utility function to sort decimals #25

Merged

Conversation

mohammedelgammal
Copy link
Contributor

Refactor sort_ascend function to avoid losing precision when sorting decimals. resolves #24

mohammedelgammal and others added 5 commits December 11, 2024 03:55
…) to O(N) using IntroSort Algorithm

Median now uses introSelect algorithm merging between quickSelect and medianOfMedians Algorithm
feat[DataTomeUtils]: Adding dt_min helper function to get minimum value between two values and swap to swap two values
resolves (AlexandreHiroyuki#18)
Copy link
Owner

@AlexandreHiroyuki AlexandreHiroyuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Everything seems fine to me.

template <typename T>
const T &dt_min(const T &a, const T &b) {
template <typename TypeOfArray>
const TypeOfArray &dt_min(const TypeOfArray &a, const TypeOfArray &b) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change to comply with the standard used on the codebase! I was thinking of writing it myself. Thank you for noticing it.

@AlexandreHiroyuki AlexandreHiroyuki merged commit 3092fcb into AlexandreHiroyuki:main Dec 27, 2024
3 checks passed
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.

Refactor sort_ascend Utility Function to precisely sort decimal numbers
2 participants