-
-
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
feat: added implementation for average mode #1552
base: master
Are you sure you want to change the base?
Conversation
@appgurueu and @raklaptudirm, sorry to ping, but could you please check this PR maybe? 😅 |
Hello? Anyone here? @appgurueu & @raklaptudirm? |
Hmm I think this algorithm may be too trivial to warrant inclusion in the repo. @appgurueu what do you think? |
Any updates? (I was away for a while) |
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 sorry for the late reply; this got caught in the Hacktoberfest...
Code-wise this looks okay (formatting nitpick: Why no space before (
for flow control statements?). You should document what exactly this returns, though (sorted array of modes). Where does the "average" in the name come from?
The tests should use it.each
.
This is relatively simple, but I think we can include it anyways; it implements an established concept from statistics, and is not too trivial.
counts.set(entry, count + 1) | ||
|
||
if(max < count + 1) | ||
max = count + 1 |
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.
You could write this as max = Math.max(max, count + 1)
This pull request aims to add the implementation for Average Mode
I did not however run
npm run test
, for it seems it modified over 700 files, many of which I didn't understand the reason for. Hence I just tried to stick to the standards by myself as much as I could.know more
Describe your change:
Checklist:
Example:
UserProfile.js
is allowed butuserprofile.js
,Userprofile.js
,user-Profile.js
,userProfile.js
are notFixes: #{$ISSUE_NO}
.