answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Which algorithm design technique is used in the bubble sort algorithm?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you modify the bubble sort algorithm to search to sort an array of characters instead of array of integers?

The bubble sort algorithm can be applied to an array of characters. Every character can be translated to an integer equivalent via the ascii table


Bubble sort Extra or in space?

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


What are the advantages for bubble sort?

Bubble sort has no practical applications other than that it is often cited as an example of how not to write an algorithm. Insert sort is the best algorithm for sorting small lists of items and is often used in conjunction with quick sort to sort larger lists. Like insert sort, bubble sort is simple to implement and is a stable sort (equal items remain in the same order they were input). However, insert sort uses copy or move operations rather than swaps (which is actually three operations per swap) and is therefore quicker. The only time a bubble sort will work quicker than insert sort is when the array is already sorted, which renders the entire algorithm redundant. A modified algorithm that specifically tests if an array is sorted or not would be more efficient than a single-pass bubble sort.


Is it trueThe biggest advantage of the bubble sort algorithm is that values move only by one element at a time toward their final destination in the array?

This is false. The movement described is a disadvantageof bubble sort.


In the bubble sort algorithm the second loop iterates ---------- for each of the unsorted array elements?

n-1 times


Why is the Bubble Sort algorithm also referred ro as Sink Sort?

Bubble sort got its name because if you could watch the way your data was changing, on each iteration you would see the greatest number "bubble" to the top.Similarly, you could said that you would see the lowest number "sink" to the bottom.


How do you sort an array of numbers?

Use a sorting algorithm. There are a bewildering number of sorting algorithms, both stable and unstable. To sort numbers, an unstable sort suffices. The algorithm you use will depend on how many numbers need to be sorted (a small or a large set), however a hybrid algorithm (a combination of two or more algorithms) can cater for both. Introsort (unstable) and timsort (stable) are the two most common hybrid sorting algorithms.


What is the worst case and best case of bubble sort?

There is no worst case for merge sort. Each sort takes the same amount of steps, so the worst case is equal to the average case and best case. In each case it has a complexity of O( N * log(N) ).


What is a bubble sort used for?

Bubble sort, incorrectly referred to as sinking sort is a simple sorting algorithm (step by step procedure of calculations) that works to repeatedly step through list to be sorted. With the comparing of each adjacent items and swapping them into the correct order. This repeated until there are no swaps needed and the list of items are sorted.


What is another name for bubble sort?

Bubble sort is also known as sinking sort.


What is the minimum number of comparisons in bubble sort?

A bubble sort may have a range from O(n-1) for a pre-sorted array, to O(n2-n) for a poorly implemented bubble sort algorithm. Given 20 elements, a best case scenario is 19 comparisons, and the worst case is 380 comparisons.


What is complex sort?

Time complexity Best case: The best case complexity of bubble sort is O(n). When sorting is not required, all the elements are already sorted. Average case: The average case complexity of bubble sort is O(n*n). It occurs when the elements are jumbled, neither properly ascending nor descending. Worst case: The worst-case complexity of bubble sort is O(n*n). It occurs when the array elements are needed to be sorted in reverse order. Space complexity In the bubble sort algorithm, space complexity is O(1) as an extra variable is needed for swapping.