Programming and Computer Science in Java:
Class Notes:  Wed, Feb 5, 2003
David Kosbie, 2002-2003

1.  Information

• My web page: www.kosbie.net
• 10th period time conflicts (names to me)
• Home machines, next week
• Connectivity: maybe (working on it)
• Java in the classroom status (sigh...)
• Java at home status
• Q+A

2.  Homework

• No homework due today
• Due tomorrow:
• hw #2
• Quiz Friday!

3.  Review

• Chapter 1 (and quiz)
• Insertion sort
• Selection sort
• PSVM
• Bits, bytes, binary

4.  More Sorting Algorithms

• Insertion sort:  Repeatedly insert the top card from the unsorted stack into its sorted position in the sorted stack.
• Selection sort:  Repeatedly select the smallest remaining card from the unsorted stack and place it on the top of the sorted stack.
• Bubble sort:  Repeatedly sweep through stack, swapping cards which are out of order.
• Merge sort:  Repeatedly divide stack in halves, sort each half recursively using mergesort, then merge the two sorted halves into a sorted stack.
• Radix sort, Tree sort, Heap sort, etc, etc, etc.:  Not yet.

5.  First Java Programs!

• Hello World (from yesterday)
• psvm, print, println, squiggly braces
• Variables
• int foo;
• String bar;
• Assignment
• foo = 5;
• bar = “howdy”;
• Operators
•    +    -    *     /     + for Strings
• Precedence
• 1+2*3
• 1*2+3

6.  Glossary

 Variable Value Type Keyword Statement Declaration Assignment Expression Operator Operand Precedence Concatenate Composition Integer division