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. |
Panquesito7 left a comment
There was a problem hiding this comment.
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. |
Panquesito7 left a comment
There was a problem hiding this comment.
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.
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.
I think you are referring to these 3 variables being used lo , hi and mid to make them uint64_t instead of int.
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>
Panquesito7 left a comment
There was a problem hiding this comment.
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.