Searching and Sorting

Jim Mahoney
September 29 2004

This notebook looks at the binary search and bubble sort algorithms.
Both are implemented as programs, and then analyzed for how costly they are.

This week's assignment asks you to play around with something like this, for a different sorting function;
however, I've put more technical stuff into these programs than I expect you to do for your own work.

Definitions

Testing

O(n) examination of a search algorithm : binarySearch[ {1,10,20,30},  10]

O(n) examination of sort algorithm : bubbleSort[ {3,2,2,1} ]

Built-in Mathematica stuff

A bit about ListPlot[] and Fit[]


Created by Mathematica  (September 29, 2004)