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

Update binary_insertion_sort.cpp #2738

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

khushbooshakya
Copy link

@khushbooshakya khushbooshakya commented Sep 24, 2024

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

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

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.
@khushbooshakya
Copy link
Author

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.

* \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
Copy link
Collaborator

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
Copy link
Collaborator

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.
Copy link
Collaborator

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
Copy link
Collaborator

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

@realstealthninja realstealthninja added the requested changes changes required label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requested changes changes required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants