-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
feat: add dnf sort #1558
feat: add dnf sort #1558
Conversation
Nice 😃, Have a look at the formatting that matches repository standards here and consider refactoring. 😃 |
@foo290 I have made some changes please have a look. |
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.
Hello, @heysujal; thanks for your contribution! Sadly, your code is not up to the repository standards.
Please read them carefully, and take your time. 🙂
@Panquesito7 Got it, I will be making changes again.Meanwhile, I found Counting Sort not following the standards. Is it okay , if I use the code of GeeksForGeeks as long as I am giving their reference ? |
For me, that sounds good, as long as you mention where you took it from. @ayaankhan98, @mishraabhinn, thoughts? |
@Panquesito7 I have done some changes and tried to keep code up to the standards. Please give your review. |
Hi @heysujal Consider using uint64_t for non-negative values (or their appropriate size: uint32_t, uint16_t, uint8_t) or int64_t for negative values in the |
@Swastyy Done the changes , have a look. |
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.
Amazing work! 😄👍
Please enable GitHub Actions in your repository of this fork in this link: https://github.com/heysujal/C-Plus-Plus/actions
sorting/dnf_sort.cpp
Outdated
template <typename T> | ||
std::vector<T> dnfSort(const std::vector<T> &in_arr) { | ||
std::vector<T> arr(in_arr); | ||
int lo = 0; |
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.
Consider using uint64_t
for non-negative values (or their appropriate size: uint32_t
, uint16_t
, uint8_t
) or int64_t
for negative values. Check other parts of the code (reference). 🙂
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.
I think you are referring to these 3 variables being used lo
, hi
and mid
to make them uint64_t
instead of int
.
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.
Correct.
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
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.
LGTM. Awesome work, @heysujal! You've done great work for this PR to be your first contribution in The Algorithms. We hope you keep contributing. Keep up the good work! 😄👍🎉
Thank you for helping me out and giving feedback. |
Closes #1549
Added dnf sort.