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

fixing JSDOCS for Sorts Folder the folder that been modified are Alph… #1649

Conversation

mohmmadAyesh
Copy link

…aNumerical,BeadSort,BogoSort,BubbleSort,CocktailShakerSort,CountinfSort,FindSecondsLargestElementSort,FisherYatesShuffle

Open in Gitpod know more

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • [ x] Documentation change?

Checklist:

  • [ x] I have read CONTRIBUTING.md.
  • [x ] This pull request is all my own work -- I have not plagiarized.
  • [x ] I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [x ] All new JavaScript files are placed inside an existing directory.
  • [ x] All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed but userprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • [x ] All new algorithms have a URL in their comments that points to Wikipedia or another similar explanation.
  • [x ] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
    Hi I added JSDOCS to Files that missing it in Sorts Folder this is a part of solving issue chore: fix / clean up jsdoc comments #1342 Fixes:#{1342} Hope you accept it

…aNumerical,BeadSort,BogoSort,BubbleSort,CocktailShakerSort,CountinfSort,FindSecondsLargestElementSort,FisherYatesShuffle
@@ -7,6 +7,9 @@
* NOTE: It only works for arrays of positive integers.
*
* Wikipedia: https://en.wikipedia.org/wiki/Bead_sort
* @param {number[]} sequence An array of positive integers to be sorted using Bead Sort.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "using Bead Sort" is not helpful here or in the next line.

@@ -1,5 +1,7 @@
/**
* Checks whether the given array is sorted in ascending order.
* @param {number[]} array The array to be checked for sorted order.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

number[] is wrong. Any comparable objects are fine. (Strings would be fine as well, for example, though the order may not be what you expect.)

The comments are also a bit redundant. You're effectively stating the same thing three times.

@@ -13,6 +15,7 @@ export function isSorted(array) {

/**
* Shuffles the given array randomly in place.
* @param {any[]} array The array to be shuffled.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this comment help?

@@ -42,6 +44,8 @@ export function bubbleSort(items) {

/**
* Using a while loop and a for loop.
* @param {number[]} arr The array to be sorted.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the array is sorted in-place.

@@ -7,6 +7,9 @@
*
* Wikipedia (Cocktail Shaker Sort): https://en.wikipedia.org/wiki/Cocktail_shaker_sort
* Wikipedia (Bubble Sort): https://en.wikipedia.org/wiki/Bubble_sort
*
* @param {number[]} items The array of numbers to be sorted.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, please note that the sorting is in-place

@@ -1,3 +1,8 @@
/**
* Shuffles the elements of the given array randomly in place.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again you only really need one of the comments.

@mohmmadAyesh
Copy link
Author

This branch merged with fix-docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants