Bemutatkozik: 

Prezi AI.

Az Ön új prezentációs asszisztense.

Minden eddiginél gyorsabban finomíthatja, fejlesztheti és szabhatja testre tartalmait, találhat releváns képeket, illetve szerkesztheti vizuális elemeit.

Betöltés...
Átirat

That's all.

Thank you for listening!

CMS

Bubble Sort

SEO

Prepared by:

Jason Ryan N. Cruz

Jann Strauss A. Hulleza

Paul Cyrill Pineda

Rhea Ciarina B. Ramos

Social

SOCIAL

PLATFORMS

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm gets its name from the way smaller elements "bubble" to the top of the list. Because it only uses comparisons to operate on elements, it is a comparison sort. Although the algorithm is simple, most of the other sorting algorithms are more efficient for large lists.

The advantage of this algorithm is that, you can use this on simple problems. Without other complex algorithms, you can solve a problem with the use of sequential search. And this is faster when you are computing in a small amount of array. This is also better to use if the value we’re looking for happens to be at the first element.

The disadvantage of this algorithm is that, when there are two or more occurrences of a value in the set of given of data.

Average and worst case complexity of bubble sort is O(n^2). Also, it makes O(n^2) swaps in the worst case. Bubble sort is adaptive. It means that for almost sorted array it gives O(n) estimation. Avoid implementations, which don't check if the array is already sorted on every step (any swaps made). This check is necessary, in order to preserve adaptive property.

One problem of bubble sort is that its running time badly depends on the initial order of the elements. Big elements (rabbits) go up fast, while small ones (turtles) go down very slow.

The difference between these two sorts is the manner in which they compare the elements. The balloon sort compares the first element with each following element of the array, making any necessary swaps.

  • When the first pass through the array is complete, the balloon sort then takes the second element and compares it with each following element of the array swapping elements that are out of order. This sorting process continues until the entire array is ordered.
  • The balloon sort, in some situations, is slightly more efficient than the bubble sort. It is not necessary for the balloon sort to make that final complete pass needed by the bubble sort to determine that it is finished.

Brute Force

Sequential Searching

Balloon Sort

String Matching

Brute force is a straightforward approach to solve a problem based on the problem’s statement and definitions of the concepts involved. It is considered as one of the easiest approach to apply and is useful for solving small–sized instances of a problem.

Sequential Search or Linear Search is the simplest and most used algorithm to find a specific value to a given data. This works by checking each element of a data one at a time. The most common way of doing this algorithm is starting from the first element up to the last one, until the desired one is found. Unfortunately the sequential search is also the most ineffective searching algorithm.

The balloon sort is similar to the bubble sort, in that it compares elements of the array and swaps those that are not in their proper positions. The difference between these two sorts is the manner in which they compare the elements. The balloon sort compares the first element with each following element of the array, making any necessary swaps. When the first pass through the array is complete, the balloon sort then takes the second element and compares it with each following element of the array swapping elements that are out of order. This sorting process continues until the entire array is ordered.

String Matching

Bubble Sort

Balloon Sort

Sequential Search

Tudjon meg többet arról, hogyan készíthet dinamikus és magával ragadó prezentációkat a Prezi segítségével