Algo
Algo copied to clipboard
increasing efficiency of bubble sort
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