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

Feature/bucket sort #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

awais019
Copy link
Contributor

@awais019 awais019 commented Feb 4, 2023

I just added bucket sort. That is a small step towards completing this repo for implementation of all algorithms and data structures in typescript.

Copy link
Contributor

@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.

  1. Remove the addition of SelectionSort in this PR.
  2. 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.

@awais019 awais019 force-pushed the feature/bucket-sort branch 2 times, most recently from 649db69 to 3fd48cf Compare February 5, 2023 05:49
@awais019
Copy link
Contributor Author

awais019 commented Feb 5, 2023

I did some changes kindly review them and let me know If I'm still wrong.

@@ -0,0 +1,21 @@
import { bucketSort } from "../bucket_sort";

describe("Testing Selection sort", () => {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

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.

None yet

2 participants