Overview of Sorting - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Overview of Sorting

Description:

Donald Knuth s, The Art of Computer Programming, Vol. 3, documents dozens of algorithmic methods for sorting. Examples: bubble, insertion, selection, ... – PowerPoint PPT presentation

Number of Views:92
Avg rating:3.0/5.0
Slides: 7
Provided by: ron
Category:

less

Transcript and Presenter's Notes

Title: Overview of Sorting


1
Overview of Sorting
  • by Ron Peterson

2
Variety of Algorithms
  • There are a lot of different approaches to
    sorting, not just different programs that use
    similar methods.
  • Donald Knuths, The Art of Computer Programming,
    Vol. 3, documents dozens of algorithmic methods
    for sorting.
  • Examples bubble, insertion, selection, Shell,
    merge, heap, quick, radix are all prefixes of
    names of sorts.

3
More Sort Names
  • Bubble sort Cocktail sort Odd-even sort
    Comb sort Gnome sort Quicksort Selection
    sort Heapsort Smoothsort Cartesian tree
    sort Tournament sort Cycle sort Insertion
    sort Shell sort Tree sort Library sort
    Patience sorting Monkey-puzzle sort Merge
    sort Polyphase merge sort Strand sort
    American flag sort Bead sort Bucket sort
    Burstsort Counting sort Pigeonhole sort
    Proxmap sort Radix sort Flashsort Bitonic
    sorter Batcher odd-even mergesort Timsort
    Introsort Spreadsort UnShuffle sort JSort
    Spaghetti sort Pancake sort

4
Categories by Efficiency
  • Simple sorts O(N2)
  • Bubble, selection, insertion sorts
  • Intermediate sorts
  • Shell O(Nlog2 N)
  • Efficient sorts O(Nlog N)
  • Quicksort, merge sort, Heap sort
  • Specialty sorts
  • Radix O(C) ( of digits per value)

5
What you should know
  • For each sort discussed
  • The name
  • Its efficiency
  • Average, best, and worst
  • How it works
  • Study the individual sorts in the book and look
    at the videos on the syllabus link

6
2 more topics
  • Stable sorts
  • Used for multi-key sorts like First/Last name
  • Does not change order within key group
  • Merge sort is typically a stable sort
  • STL sort algorithms
  • Same interface for each (begin-it, end-it, opl)
  • Main approaches
  • sort(..) stable_sort(..) make_heap(..),
    sort_heap(..) plus a few tools to build others
Write a Comment
User Comments (0)
About PowerShow.com