-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fixing JSDOCS for Sorts Folder the folder that been modified are Alph… #1649
Conversation
…aNumerical,BeadSort,BogoSort,BubbleSort,CocktailShakerSort,CountinfSort,FindSecondsLargestElementSort,FisherYatesShuffle
Sorts/BeadSort.js
Outdated
@@ -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. |
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.
The "using Bead Sort" is not helpful here or in the next line.
Sorts/BogoSort.js
Outdated
@@ -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. |
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.
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.
Sorts/BogoSort.js
Outdated
@@ -13,6 +15,7 @@ export function isSorted(array) { | |||
|
|||
/** | |||
* Shuffles the given array randomly in place. | |||
* @param {any[]} array The array to be shuffled. |
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.
How does this comment help?
Sorts/BubbleSort.js
Outdated
@@ -42,6 +44,8 @@ export function bubbleSort(items) { | |||
|
|||
/** | |||
* Using a while loop and a for loop. | |||
* @param {number[]} arr The array to be sorted. |
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.
Note that the array is sorted in-place.
Sorts/CocktailShakerSort.js
Outdated
@@ -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. |
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.
Again, please note that the sorting is in-place
Sorts/FisherYatesShuffle.js
Outdated
@@ -1,3 +1,8 @@ | |||
/** | |||
* Shuffles the elements of the given array randomly in place. |
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.
Again you only really need one of the comments.
This branch merged with fix-docs |
…aNumerical,BeadSort,BogoSort,BubbleSort,CocktailShakerSort,CountinfSort,FindSecondsLargestElementSort,FisherYatesShuffle
know more
Describe your change:
Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$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