Algo icon indicating copy to clipboard operation
Algo copied to clipboard

increasing efficiency of bubble sort

Open mishrasushruti99 opened this issue 7 years ago • 0 comments

Fixes #

Checklist

  • [x] I have read the [Contribution Guide] and my PR follows them.
  • [x] 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
  • [x] I have added necessary documentation (if appropriate)
  • [x] 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

mishrasushruti99 avatar Oct 31 '17 03:10 mishrasushruti99