-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Feature/bucket sort #97
base: master
Are you sure you want to change the base?
Conversation
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.
- Remove the addition of SelectionSort in this PR.
- Your complexity analysis of BucketSort is wrong. BucketSort runs in O(max(A) - min(A)) time and space complexity, no matter how the input array is permuted.
649db69
to
3fd48cf
Compare
I did some changes kindly review them and let me know If I'm still wrong. |
sorts/test/bucket_sort.test.ts
Outdated
@@ -0,0 +1,21 @@ | |||
import { bucketSort } from "../bucket_sort"; | |||
|
|||
describe("Testing Selection 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.
Don't copy/duplicate test cases. You should apply the same tests to both selectionsort and bucketsort.
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.
It's fixed check it now.
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.
I'm afraid it still isn't fixed. Bucket sort and selection sort both solve the same problem, so when you're doing black-box testing, they should both get the same test cases. In addition to that you may do some white-box testing specific to each, but currently the test cases are duplicated.
3fd48cf
to
3ae40ff
Compare
I just added bucket sort. That is a small step towards completing this repo for implementation of all algorithms and data structures in typescript.