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

bug: Bubble sort infinite loops if 2 values are the same #217

Closed
0xKawaka opened this issue Nov 17, 2023 · 4 comments
Closed

bug: Bubble sort infinite loops if 2 values are the same #217

0xKawaka opened this issue Nov 17, 2023 · 4 comments
Labels
stale No activity for quite some time.

Comments

@0xKawaka
Copy link

I think if *array[idx1] < *array[idx2] should be replace by if *array[idx1] <= *array[idx2] since it loops infinitely swapping the 2 elements if they are the same values.
Maybe that's a feature if you want to sort an array and you know it doesn't contain duplicated values but I don't think it should be the default implementation.

@0xKawaka 0xKawaka added the bug label Nov 17, 2023
@azurwastaken
Copy link
Contributor

im on it

0xLucqs pushed a commit that referenced this issue Nov 23, 2023
## Pull Request type

Please check the type of change your PR introduces:

- [X] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

Issue Number: #217 

## What is the new behavior?

- Bubble sort don't infinite loop anymore when there is equal values

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

## Other information

Also added a test to ensure the problem doesn't happen again
sveamarcus pushed a commit to sveamarcus/alexandria that referenced this issue Dec 7, 2023
…#219)

## Pull Request type

Please check the type of change your PR introduces:

- [X] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

Issue Number: keep-starknet-strange#217 

## What is the new behavior?

- Bubble sort don't infinite loop anymore when there is equal values

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

## Other information

Also added a test to ensure the problem doesn't happen again
@github-actions github-actions bot removed the bug label Dec 11, 2023
Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale No activity for quite some time. label Jan 11, 2024
@azurwastaken
Copy link
Contributor

This issues is resolved, can someone close it ?

@github-actions github-actions bot removed the stale No activity for quite some time. label Jan 12, 2024
Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale No activity for quite some time. label Feb 12, 2024
@0xLucqs 0xLucqs closed this as completed Feb 12, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale No activity for quite some time.
Projects
None yet
Development

No branches or pull requests

3 participants