Skip to content

Conversation

@Shubham-chaudhary07
Copy link

This PR adds an optimized version of the bubble sort algorithm.
The optimization uses a 'swapped' flag that stops the algorithm
early if the array is already sorted, improving the best-case
time complexity from O(n²) to O(n).

  • Added optimized_bubble_sort.cpp
  • Added comments for clarity
  • Code follows repository style guidelines

@github-actions
Copy link
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Author has not responded to the comments for over 2 weeks label Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Author has not responded to the comments for over 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant