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

increasing efficiency of bubble sort #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mishrasushruti99
Copy link

@mishrasushruti99 mishrasushruti99 commented Oct 31, 2017

Fixes #

Checklist

  • I have read the [Contribution Guide] and my PR follows them.
  • My branch is up-to-date with the master branch.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • The contents added are complete .lt original and have no copyright issues.

Short description of what this resolves:

introduction of the swap variable will check whether or not any swaps occur while traversing the inner loop.If not ,that means that the array is sorted from that point onwards and there is no need for further checking.This shall increase efficiency.

Changes proposed in this pull request:

introduction of swap variable

-introduction of swap variable

swap variable created to count the number of swaps .If no swaps occur that means that from that position onwards array is sorted .
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