Skip to content

Feature/bucket sort#97

Open
awais019 wants to merge 1 commit into
TheAlgorithms:masterfrom
awais019:feature/bucket-sort
Open

Feature/bucket sort#97
awais019 wants to merge 1 commit into
TheAlgorithms:masterfrom
awais019:feature/bucket-sort

Conversation

@awais019
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

awais019 commented Feb 5, 2023

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

Comment thread sorts/test/bucket_sort.test.ts Outdated
@@ -0,0 +1,21 @@
import { bucketSort } from "../bucket_sort";

describe("Testing Selection sort", () => {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants