Lunes, Pebrero 13, 2012

SORTING

Research an application or scenario that the following sorting algorithms can be applied (include a description and an image):

  • Bubble Sort
known 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.








  • Selection Sort
 Selection sort is noted for its simplicity, and also has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.

Selection Sort Animation


  • Insertion Sort
 is a simple sorting algorithm: a comparison sort in which the sorted array (or list) is built one entry at a time.

 




 
  • Shell Sort
  is an in-place comparison sort. It generalizes an exchanging sort, such as insertion or bubble sort, by allowing the comparison and exchange of elements that lie far apart

 Step-by-step visualisation of Shellsort



 
  • Bucket Sort
  is a sorting algorithm that works by partitioning an array into a number of buckets. Each bucket is then sorted individually, either using a different sorting algorithm, or by recursively applying the bucket sorting algorithm.
 




  • Merge Sort
 is an O(n log n) comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output.
Merge-sort-example-300px.gif
 
  • Quick sort
  a sorting algorithm developed by Tony Hoare that, on average, makes O(nlog n) comparisons to sort n items.
 Quicksort in action on a list of numbers. The horizontal lines are pivot values.

    Walang komento:

    Mag-post ng isang Komento