answersLogoWhite

0

Passes:

bold are "sunk" into place

1: 5 19 2 7 28

2: 5 2 7 19 28

3: 2 5 7 19 28

4*: 2 5 7 19 28

*The last pass had no swaps, thus it breaks out of the sort

Efficiency: O(n^2) in random order O(n) when already sorted

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

How do write sorting of numbers using microprocessor?

There are several methods available to sort numbers. A simple way to program sorting is the so-called "bubble-sort". This is inefficient for larger lists of numbers; in which case it is more convenient to use one of the faster algorithms, for example, "quick-sort".


How can you put in order a list of telephone numbers?

You could use a bubble sort.


How many key comparison and interchanges are required to sort a file of size n using bubble sort?

rfsghdfhdh


What Program that lists telephone numbers in numeric order or street address?

In programming this could be achieved using a numeric bubble sort. Excel allows this type of sorting to be used.


What is another name for bubble sort?

Bubble sort is also known as sinking sort.


Is bubble sort a stable sorting algorithm?

Yes, bubble sort is a stable sorting algorithm.


Divide-and-Conquer to sort numbers using quick sort?

Yes, that's how quick-sort works.


Which sorting algorithm is more efficient for small datasets: bubble sort or selection sort?

Selection sort is more efficient for small datasets compared to bubble sort.


Who invented the bubble sort?

ramesh


Bubble sort Extra or in space?

Bubble sort is an "in place" algorithm. Other than a temporary "switch" variable, no extra space is required.


Ignou mca solved assignment of 3rd sem Jan 2009 free?

Sort the following list of numbers in the descending order, 187, 62, 155, 343, 184, 958, 365, 427, 78, 94, 121, 388 using each of the following methods: (i) Insertion Sort (ii) Selection Sort (iii) Heap Sort (iv) Merge Sort (v) Quick Sort Further, count the number of operations, by each sorting method.


What is bubble sort and explain with examples?

bubbles