CSC234 - Project 5
Assigned March 29th 1 p.m.
Due April 6th 12 p.m.
In this project, you will implement two sorting algorithms and analyze their performance.
The two algorithms you will implement are Bubble Sort and Shaker Sort.
Bubble sort is so named because of the similarity to bubbles rising slowly through water.
It works by repeatedly iterating through the list to be sorted, comparing each pair of adjacent
items and swapping them if they are in the wrong order. The iteration through the list is repeated
until no swaps are needed.
Implement Bubble Sort for an array of integers.
This algorithm is an attempt to improve on Bubble Sort. Each iteration through the list is reversed,
such that the first pass is from left to right, the second from right to left, the third from left
to right, etc, until all elements are sorted.
Implement Shaker Sort for an array of integers.
For each of the above algorithms, analyze the best, worst and average case performance.
Find one permuation of the integers from 1-10 where Bubble Sort outperforms Shaker Sort, and
one permutation of the integers from 1-10 where Shaker Sort outperforms Bubble Sort.
What to turn in
© Mark Goadrich 2009, Centenary College of Louisiana