Lecture Notes – April 5, 2005

 

Show  and discuss PlayWithText.java

 

Show  and discuss TestArrayList.java

 

Show and discuss TestArrayList2.java

 

Show and discuss TestArrayList3.java

 

Material on Sorting and Searching

n      Web

n      Introduction to Computer Science, chapter 6.4 and 6.5

n      Lewis and Loftus 9.4 and 9.5

http://maven.smith.edu/~thiebaut/java/sort/demo.html

http://cg.scs.carleton.ca/~morin/misc/sortalg/

 

Talk about sorting

Act out sorts

                   Bubble

                   Insertion

                   Selection

                   Merge

 

Show and discuss  Sorting2.java

Show and discuss  Sorting3.java

 

Talk about Searching

          Act out

                   Linear  - list of n items,  on average, search looks at  n/2  items

                   Binary  - list of n items   search looks at  log2n items