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

adding fix #1342 fixing docs for FenWickTree and DepthFirstSearch #1647

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

mohmmadAyesh
Copy link

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}.
    I fix docs of fenWickTree and DepthFirstSearch it to be able to use jsdocs its part of solving chore: fix / clean up jsdoc comments #1342

@mohmmadAyesh
Copy link
Author

I fix docs of BreadthFirstTreeSearch it to be able to use jsdocs its part of solving #1342

appgurueu
appgurueu previously approved these changes Mar 27, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 82.32446% with 73 lines in your changes are missing coverage. Please review.

Project coverage is 84.06%. Comparing base (bd34e9f) to head (7651b8b).
Report is 1 commits behind head on master.

Files Patch % Lines
Search/LinearSearch.js 0.00% 28 Missing ⚠️
Maths/FriendlyNumbers.js 0.00% 12 Missing ⚠️
Search/StringSearch.js 0.00% 11 Missing ⚠️
Recursive/TowerOfHanoi.js 0.00% 9 Missing ⚠️
Recursive/SubsequenceRecursive.js 0.00% 8 Missing ⚠️
Maths/MatrixExponentiationRecursive.js 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1647      +/-   ##
==========================================
- Coverage   84.07%   84.06%   -0.01%     
==========================================
  Files         375      375              
  Lines       19688    20031     +343     
  Branches     2913     2914       +1     
==========================================
+ Hits        16552    16840     +288     
- Misses       3136     3191      +55     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


/**
* Comparator function to sort numbers in ascending order.
* @param {number} num1
Copy link
Collaborator

Choose a reason for hiding this comment

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

The three lines starting here are not useful.

@@ -6,6 +6,10 @@
*/

// factorial utility method.
/**
* @param {Number} n
* @returns {Number} the factiorial of n
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo: factiorial (I would also say this is self-explanatory, and since it's just a helper, doesn't need a comment; ideally this file should import the factorial implementation).

/**
*
* @param {Number} n
* @returns {Number} count of numbers b/w 1 and n that are coprime to n
Copy link
Collaborator

@appgurueu appgurueu Mar 30, 2024

Choose a reason for hiding this comment

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

"b/w" is confusing. Please write "between" out. This should also be consolidated with the definition given above.

Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Many comments are not consolidated with existing comments. Consider

/*
 * Given a string s, return all possible palindrome partitionings of s.
 * Given a string s, return all possible palindrome partitionings of s.
 * A palindrome partitioning partitions a string into palindromic substrings.
 * A palindrome partitioning partitions a string into palindromic substrings.
 * @see https://www.cs.columbia.edu/~sedwards/classes/2021/4995-fall/proposals/Palindrome.pdf
 * @see https://www.cs.columbia.edu/~sedwards/classes/2021/4995-fall/proposals/Palindrome.pdf
 */
 */
/**
 * Returns all possible palindrome partitionings of a given string.
 * @param {string} s
 * @returns {string[][]} - Array of arrays containing all possible palindrome partitionings.
 */

These should be one comment, not two. Redundant information should not be stated twice. You need to consolidate the new doc comments with existing comments.

There are also quite a few mostly redundant comments like * @param {Number} num1. These are slightly helpful because they specify types (though the types may be clear from context, as in this case), but still are mostly noise. Please document what the parameters and return values are properly in these cases, or remove the comments entirely.

@@ -6,7 +6,9 @@
* https://www.mathsisfun.com/definitions/factor.html
*
*/

/**
* @param {Number} [number=0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not useful.

*
* @param {Number} x
* @param {Number} y
* @returns {(string|number)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be explained; ideallly the errors should be thrown instead of returned.

@@ -14,6 +14,12 @@
import { findHCF } from './FindHcf'

// Find the LCM of two numbers.
/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unhelpful comment

@@ -4,7 +4,10 @@
Source: https://en.wikipedia.org/wiki/Friendly_number
See also: https://mathworld.wolfram.com/FriendlyNumber.html#:~:text=The%20numbers%20known%20to%20be,numbers%20have%20a%20positive%20density.
*/

/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, this comment is unhelpful

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.

3 participants