Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Bubble sort

Simplistic in concept, the bubble sort theory received its name from the principle that bubbles of air contained within water will rise to the surface by displacing the heavier, surrounding water molecules on their way.

The bubble sort algorithm is performed by starting at the beginning of a data set, comparing, and swapping adjacent elements as it proceeds through to the end. The bubble sort will continue making passes across the data set from the beginning until there are no more elements swapped.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial