Skip to content

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

Open
mohmmadAyesh wants to merge 28 commits into
TheAlgorithms:masterfrom
mohmmadAyesh:fix-jsdocs
Open

adding fix #1342 fixing docs for FenWickTree and DepthFirstSearch#1647
mohmmadAyesh wants to merge 28 commits into
TheAlgorithms:masterfrom
mohmmadAyesh:fix-jsdocs

Conversation

@mohmmadAyesh
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

codecov-commenter commented Mar 27, 2024

Codecov Report

❌ Patch coverage is 82.32446% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.06%. Comparing base (bd34e9f) to head (7651b8b).
⚠️ Report is 31 commits behind head on master.

Files with missing lines 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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mohmmadAyesh mohmmadAyesh requested a review from appgurueu March 29, 2024 07:25
Comment thread Maths/AverageMedian.js

/**
* Comparator function to sort numbers in ascending order.
* @param {number} num1
Copy link
Copy Markdown
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.

// factorial utility method.
/**
* @param {Number} n
* @returns {Number} the factiorial of n
Copy link
Copy Markdown
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).

Comment thread Maths/EulersTotient.js
/**
*
* @param {Number} n
* @returns {Number} count of numbers b/w 1 and n that are coprime to n
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread Maths/Factors.js
*/

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

Choose a reason for hiding this comment

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

Not useful.

Comment thread Maths/FindHcf.js
*
* @param {Number} x
* @param {Number} y
* @returns {(string|number)}
Copy link
Copy Markdown
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.

Comment thread Maths/FindLcm.js
import { findHCF } from './FindHcf'

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

Choose a reason for hiding this comment

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

Unhelpful comment

Comment thread Maths/FriendlyNumbers.js
See also: https://mathworld.wolfram.com/FriendlyNumber.html#:~:text=The%20numbers%20known%20to%20be,numbers%20have%20a%20positive%20density.
*/

/**
Copy link
Copy Markdown
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