-
-
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
Update binary_insertion_sort.cpp #2738
Conversation
Improved Commenting Explanation: General Overview: Detailed explanation of each function and its purpose. Clearly indicates what each parameter is and how the function works. Algorithm Details: The purpose of binary search and how it helps improve the performance of insertion sort is explained. Describes how each element is inserted in the correct place by shifting larger elements to the right. Test Function: Comments explain what each test case is doing, what type of data is being sorted, and how the program verifies if the sorting is successful. This should help anyone reading the code to understand not only how the code works but also why each part is necessary.
Improved Commenting Explanation: Detailed explanation of each function and its purpose. The purpose of binary search and how it helps improve the performance of insertion sort is explained. Comments explain what each test case is doing, what type of data is being sorted, and how the program verifies if the sorting is successful. |
* \f{bmatrix}{30 &40 &20 &50 &10\f} | ||
* 3. In the next iteration we are at 20 we find that this is also misplaced so | ||
* we place it at the correct sorted position thus the array in this iteration | ||
* becomes |
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.
this was an unnecessary deletion. This is the format we use for documenting files
|
||
/** | ||
* \namespace sorting | ||
* @brief Sorting algorithms | ||
* @brief Contains sorting algorithms |
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.
why are we plagiarizing already documented namespaces
* \param low The lower bound of the range we are searching in. | ||
* \param high The upper bound of the range we are searching in. | ||
* \returns the index of most suitable position of val. | ||
* \brief Binary search function to find the correct position for an element. |
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.
replace 's with @'s
*/ | ||
int main() { | ||
test(); // run self-test implementations |
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 do not modify this comment
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions! |
Improved Commenting Explanation:
General Overview:
Detailed explanation of each function and its purpose. Clearly indicates what each parameter is and how the function works. Algorithm Details:
The purpose of binary search and how it helps improve the performance of insertion sort is explained. Describes how each element is inserted in the correct place by shifting larger elements to the right. Test Function:
Comments explain what each test case is doing, what type of data is being sorted, and how the program verifies if the sorting is successful. This should help anyone reading the code to understand not only how the code works but also why each part is necessary.
Description of Change
Checklist
Notes: