Starting Out with C++: Early Objects
Starting Out with C++: Early Objects
8th Edition
ISBN: 9780133360929
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: Addison-Wesley
Question
Book Icon
Chapter 9.3, Problem 9.7CP
Program Plan Intro

Bubble sort

Bubble sort is used to sort the group of data.

  • It starts to compare the pair of elements in the array from bottom to top.
  • The smallest elements are “bubbled up” to the top of the array.
  • In pair of elements, if the bottom element is smaller than the top element; then the swap is performed.
  • The swap operation places elements in ascending order which means from smallest to biggest element.

Blurred answer
Students have asked these similar questions
After one pass of selection sort, which value is in order?
How Quick Sort Works?
Which sort usually requires fewer data values to be swapped, bubble sort or selection sort?

Chapter 9 Solutions

Starting Out with C++: Early Objects

Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage