Skip to content

Conversation

@MuhammedHamzatkt
Copy link

This PR adds an optimized version of the Bubble Sort algorithm in Java.

Changes:

  • Uses the last swap index to reduce unnecessary comparisons.
  • Works on partially sorted arrays more efficiently.
  • Added test case in main() to demonstrate sorting.

This contributes to the sorting algorithms collection by improving performance for nearly sorted arrays.

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.

1 participant