Lecture 24 - April 17, 2007

 

Review Lab 25

    key :  

   code : 

 

    testVector example  

 

Slides from lecture

 

Discuss Programming Assignment

 

Know

Bubble Sort

Selection Sort

Insertion Sort

 

Big Oh notation for searching

            O(n) for sequential search of an array

            O(log n) for binary search of an ordered array

            O(1) for using hash table to locate an item - constant time

 

 

Only suitable for searching randomly accessible data structures.

Binary Search  code from Chapter 8

Recursive Binary Search  code from Chapter 15

 

Treasure hunt type storage - insertions and deletions easy,  binary search not possible

                       

Array -  insertions and deletions into an ordered list time consuming.