Sorting Algorithms Exercises

  < Previous  Next >
  1. Discuss with your neighbor(s) how the following sorting algorithms work:
    1. Insertion sort
    2. Bubble sort
  2. Trace the following algorithms sorting the following array:
    6 4 10 2 8 0
    Write the contents of the array according to each specified criterion.
    For swaps, put a star above the number(s) that are swapped.
    1. Insertion sort (at the end of each iteration of the outer loop)
    2. Bubble sort (after each swap)
  3. Write down the major steps for the following sorting algorithms:
    1. Insertion sort
    2. Bubble sort
  4. Write down the following properties for the stated sorting algorithms:
      Best-case
      Big-Oh  
      Average-case
      Big-Oh  
      Worst-case
      Big-Oh  
      Stable?     Extra  
      Space  
      Distinguishing  
      Features  
    Insertion Sort            
    Bubble Sort            
    1. Last Modified: