Words of Wisdom:

"Dinner is ready when the smoke alarm goes off" - Rabaxter

TEN SORTING OF AN ALGORITHMS

  • Date Submitted: 04/10/2011 06:26 PM
  • Flesch-Kincaid Score: 55.3 
  • Words: 943
  • Essay Grade: no grades
  • Report this Essay
TEN SORTING OF AN ALGORITHMS

Bubble sort
The bubble sort works by passing sequentially over a list, comparing each value to the one immediately after it. If the first value is greater than the second, their positions are switched. Over a number of passes, at most equal to the number of elements in the list, all of the values drift into their correct positions (large values "bubble" rapidly toward the end, pushing others down around them). Because each pass finds the maximum item and puts it at the end, the portion of the list to be sorted can be reduced at each pass. A boolean variable is used to track whether any changes have been made in the current pass; when a pass completes without changing anything, the algorithm exits.

Counting sort
Counting sort is a stable sort and has a running time of Θ(n+k), where n and k are the lengths of the arrays A (the input array) and C (the counting array), respectively. In order for this algorithm to be efficient, k must not be much larger than n.
Counting sort is commonly used within other sorting algorithms such as radix sort, since radix sort processes by counting occurrence of digits of a limited number of bits, thus limiting the size of the count table.

Stooge sort
Stooge sort is a recursive sorting algorithm with a time complexity of O(nlog 3 / log 1.5 ) = O(n2.7095...). The running time of the algorithm is thus extremely slow compared to efficient sorting algorithms, such asMerge sort, and is even slower than Bubble sort, a canonical example of an extremely slow and simple sort.

Merge sort
Merge sort is an O(n log n) comparison-based sorting algorithm. Most implementations produce a stable sort, meaning that the implementation preserves the input order of equal elements in the sorted output. It is a divide and conquer algorithm. Merge sort was invented by John von Neumann in 1945

Heap sort
Heap sortis a comparison-based sorting algorithm, and is part of the selection sortfamily. Although somewhat...

Comments

Express your owns thoughts and ideas on this essay by writing a grade and/or critique.

  1. No comments