What is the application of bubble sort?
Answers
Answer:
Bubble Sort:-
- It's a simple algorithm used to sort an unsorted list of elements preferably in ascending order.
- The basic concept is we test every element with the succeeding one to check whether the element is in order or not.
Application of Bubble Sort :-
It is used in academia to introduce 1st-year computer science students to the concept of a sorting algorithm.
It is comparably simpler to understand than some other sorting algorithms. You quickly move beyond it after it is introduced.
In the industry, I do not know of a single use of it, as there are several others that are significantly more efficient.
“The only significant advantage that bubble sort has over most other implementations, even quicksort, but not insertion sort, is that the ability to detect that the list is sorted efficiently is built into the algorithm. When the list is already sorted (best-case), the complexity of bubble sort is only O(n). By contrast, most other algorithms, even those with better average-case complexity, perform their entire sorting process on the set and thus are more complex. However, not only does insertion sort have this mechanism too, but it also performs better on a list that is substantially sorted (having a small number of inversions).”
Bubble sort should be avoided in the case of large collections. It will not be efficient in the case of a reverse-ordered collection.
If It Helps Mark as Brainliest
Bubble sort and its Applications
Explanation:
Bubble sort:
Bubble sort is a sorting algorithm , that basically compares each pair of adjacent elements and swap them only if they are in the wrong order. This passes procedure is repeated until there is no swaps required, indicating that the list is sorted. It sorts the given elements in ascending order
Example
These elements are to be sorted ( 6 1 4 2 8 ) –> ( 1 6 4 2 8 )
Bubble sort algorithm compares the first two elements(6>1) it swaps then 6>4 swaps goes on and stops 6<8
Applications of Bubble sort :
- Bubble sort is a sorting algorithm that is used to sort the elements in an ascending order.
- It uses less storage space
- Bubble sort can be beneficial to sort the unsorted elements in a specific order.
- It can be used to sort the students on basis of their height in a line.
- To create a stack , pile up the elements on basis of their weight