-
- Notifications
You must be signed in to change notification settings - Fork 7.7k
feat: add Pigeonhole algorithm #1028
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
Conversation
| @Panquesito7 , can you please let me know what are the actual issues with the code formatter? I defined everything as per the contribution guidelines. |
You are using c-style arrays for initialization. Either use a pointer or replace it with vector |
Panquesito7 left a comment
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.
Please fix clang-tidy warnings.
The warning is telling to use std::vector on line 34, but it's already std::vector |
It's still wrong, it's a C VLA array, which is not good. |
| The repo CI tools build live documentations using doxygen and hence require a certain standard and protocol to be followed. |
Panquesito7 left a comment
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.
Looks much better. Good work! 👍
Now, let's add a namespace, to ensure all functions are together.
Let us also improve the code to make refined. 🙂
sorting/pigeonhole_sort.cpp Outdated
| #include <iostream> //for io operations | ||
| | ||
| /** | ||
| *Pigeonhole sorting of array with array size n |
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.
Missing parameter and return statement documentation.
Suggested changes applied Co-authored-by: David Leal <halfpacho@gmail.com>
This comment has been minimized.
This comment has been minimized.
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>
| /** | ||
| * Pigeonhole sorting of array of size n | ||
| * The function will sort the array through Pigeonhole algorithm and print | ||
| * @param arr unsorted array of elements |
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.
| * @param arr unsorted array of elements | |
| * @param arr unsorted array of elements | |
| * @param n number of times loop will run |
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.
n is not needed. isn't it same as the template variable N?
"Number of times loop will run" -> isn't this the number of values in your array?
Co-authored-by: David Leal <halfpacho@gmail.com>
Panquesito7 left a comment
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.
Excellent work; LGTM. 👍😄
Thank you for your contribution.
@kvedala please review as well. Thanks.
kvedala left a comment
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.
there seem to be some problems in the code. please check the comments. Thank you
| /** | ||
| * Pigeonhole sorting of array of size n | ||
| * The function will sort the array through Pigeonhole algorithm and print | ||
| * @param arr unsorted array of elements |
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.
n is not needed. isn't it same as the template variable N?
"Number of times loop will run" -> isn't this the number of values in your array?
| Any reason to use |
I was getting an error involving incompatible data types. I could overcome this issue through the use of |
got it, |
kvedala left a comment
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.
👍 please check the comments
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
kvedala left a comment
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.
👍
Description of Change
Checklist
Notes: