Click here to Skip to main content
12,453,354 members (60,023 online)
Click here to Skip to main content

Tagged as

Stats

0 views
Posted

Bubble sort modifications

, 3 Nov 2012 CPOL
To handle the "no swap" situation, here is my proposal: When entering the outer loop, save the value of i in a temporary variable and set i to length - 1 (this value will cause an exit at the next iteration). And in the body of the if test (i.e. when a swap is made), restore the value of...

Revisions


  

Compare Revision Minor Date Status Editor
2 - publicly available No 3-Nov-12 19:07 Available YvesDaoust
Updates in content. 4 changes had been made.
1 No 3-Nov-12 19:05 Available YvesDaoust

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

YvesDaoust
CEO VISION fOr VISION
Belgium Belgium
I fell into applied algorithmics at the age of 16 or so. This eventually brought me to develop machine vision software as a professional. This is Dreamland for algorithm lovers.

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 3 Nov 2012
Article Copyright 2012 by YvesDaoust
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid