CS200 Fall 2009 Class Overview - Prof. Anton W. Bohm, Lab Reports of Computer Science

An overview of the cs200 class offered in fall 2009, including the class structure, differences from previous courses, grading policies, and course goals. Topics covered include algorithms, data structures, complexity analysis, abstract data types, and implementing adts using java.

Typology: Lab Reports

Pre 2010

Uploaded on 11/08/2009

koofers-user-5m3
koofers-user-5m3 🇺🇸

5

(1)

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
CS200 - Class Overview 1
CS200 Fall 2009
Instructor: Wim Bohm
Teaching Assistant: Artem Sokolov
CS200 - Class Overview 2
CS200 structure
Quizzes & Class Participation:
“are you with us?”
Tests:
“what have you learned?”
Programming assignments:
“can you implement it?”
Written assignments:
“do you understand the underlying theory?”
Check the CS200 webpage
CS200 - Class Overview 3
Class meetings
Lectures
Programming: algorithms, data structures
Theory: complexity
Recitation (in Lab hours)
L04 has been cancelled (sorry!)
L04 people need to drop the class and reregister for
another lab.
Help you with programming and homework
assignments, reinforce material from lecture.
you get credit for attending and participating in
recit!
CS200 - Class Overview 4
Difference from CS160/161
More freedom in how to structure your
program
Larger programs, continuing assignments
Team programming
pf3
pf4
pf5

Partial preview of the text

Download CS200 Fall 2009 Class Overview - Prof. Anton W. Bohm and more Lab Reports Computer Science in PDF only on Docsity!

CS200 - Class Overview 1

CS200 Fall 2009

Instructor: Wim Bohm

Teaching Assistant: Artem Sokolov

CS200 - Class Overview 2

CS200 structure

 Quizzes & Class Participation:

“are you with us?”

 Tests:

“what have you learned?”

 Programming assignments:

“can you implement it?”

 Written assignments:

“do you understand the underlying theory?”

 Check the CS200 webpage

CS200 - Class Overview 3

Class meetings

 Lectures

 Programming: algorithms, data structures

 Theory: complexity

 Recitation (in Lab hours)

 L04 has been cancelled (sorry!)

 L04 people need to drop the class and reregister for

another lab.

 Help you with programming and homework

assignments, reinforce material from lecture.

 you get credit for attending and participating in

recit!

CS200 - Class Overview 4

Difference from CS160/

 More freedom in how to structure your

program

 Larger programs, continuing assignments

 Team programming

CS200 - Class Overview 5 Grading Programming assignments 30% Written assignments 10% Quizzes 10% Recitation (attendance + completion) 5% Midterms (2) 20% Final 25% You need to have a passing grade on the exams to get a passing grade in the course CS200 - Class Overview 6 Policies “Trust men and they will be true to you; treat them greatly and they will show themselves great.” Ralph Waldo Emerson Be professional. We are all here to learn. CS200 - Class Overview 7 Course Goals

To understand programs at different levels

 Logical view  Program = Algorithms + Data Structures  Understand their relationship and use them correctly, efficiently  Implementation  Program = Objects + Methods  Practice design and implementation of object-oriented programs in Java  Analysis  Study the complexity of programs, deriving Order of Magnitude expressions for their time and space use CS200 - Class Overview 8 Course Goals  An understanding of a variety of common data structures  A practical understanding of where they are applicable

Implementing ADTs  Interface : Java construct that specifies method headers, constants What does it mean to implement an interface? How do you express it? Which interfaces did you meet in cs161? Which interface does an ArrayList implement? Do you remember some methods? CS200 - Class Overview 13 CS200 - Class Overview 14 ADT for a List

 A list: a collection of elements indexed by an

integer

 What methods should be included?

CS200 - Class Overview 15 ADT for a List, e.g. …  Create

 createList()

 Add

 add(index:integer, item:ListItemType)

 Remove

 remove(index:integer)

 removeAll()

 Ask

 isEmpty():boolean

 size():integer

 get(index):ListItemType

 Let’s play CS200 - Class Overview 16 Specifying ADT  Describe:  Methods that are visible (public)

 Parameters

 Return values

 Pre condition: what they expect

 Post condition: what they deliver

 What must the method do if pre holds?

 What must the method do if pre does not hold?

CS200 - Class Overview 17 Specifications: example

 createList() // creates an empty list

 isEmpty():boolean // returns true if list is empty

 size():integer // returns # of items in list

 add(index:integer, item:ListItemType)

// Inserts item at position index of a list, if

// 1<=index<=size()

// When inserted, elements with position >=index are

// renumbered to position + 1.

// Throws an exception when index is out of range or

// list is full.

CS200 - Class Overview 18 Specifications example (cont.)

 remove(index:integer)

// Removes the item at position index, if 1<=index<=size(). // After removal, elements with position >= index are // renumbered to position-1. // Throws an exception when index is out of range or // list is empty.

 removeAll() // Removes all elements from list

 get(index):ListItemType

// Returns the item at position index if 1<=index<=size(). // List is not changed. // Throws an exception if index is out of range. CS200 - Class Overview 19 An Array Based Implementation Public class ListArrayBased implements ListInterface { private static final int MAX_LIST = 50; private Object items[]; private int numItems; public ListArrayBased() { items = new Object[MAX_LIST]; numItems = 0; } public boolean isEmpty() { return (numItems == 0); } CS200 - Class Overview 20 Implementation (cont) public int size() { return numItems; } public void removeAll() { items = new Object[MAX_LIST]; numItems = 0; } public Object get (int index) throws ListIndexOutOfBoundsException { if (index >=1 && index <= numItems) { return items[index - 1]; } else { // index out of range throw new ListIndexOutofBoundsException(); } }