CSCI 1320 - Principle of Algorithm Design I

Spring 2008

MWF 8:30-9:20am, 228 HAS

Professor: Yu Zhang Office: 201H HAS Phone: 7399 Email: yzhang@cs.trinity.edu Office hours: MWF 11:30am-1:30pm or by appointment
Lab hours: MW 4:30-6:30pm, 228 HAS
TA: Michael Pellon Michael.Pellon@Trinity.edu

Course Pre-requisites

None.

Textbook

Forouzan and Gilberg, Computer Science: A Structured Programming Approach Using C, Third Edition, Thomson Course Technology, 2005.

Supplemental Readings

Schildt, C the Complete Reference, McGraw Hill, 2000, Fourth Edition.

Course URL

http://www.cs.trinity.edu/~yzhang/teaching/spring2008/CSCI1320/.

Goals of This Course

  1. To understand organization and characteristics of computer science.
  2. To learn fundamental problem solving methodology.
  3. To apply problem solving techniques to algorithm design.
  4. To build abstractions with procedures and data.
  5. To develop good programming habits.
  6. To learn programming in the C computer language.

At the end of this course you should

  1. Be able to describe basic concepts, nomenclature, and history of computers and computing.
  2. Be able to solve simple problems with a computer, using math and science skills.
  3. Understand and be able to implement software design principles, including abstraction, modularity, data representation, and portability.
  4. Be able to properly document program code.
  5. Be able to describe and implement software engineering concepts, including requirements definition, analysis, design, implementation, testing, and maintenance considerations.
  6. Be able to development and execute computer programs using structured techniques.

Email and WWW

We will be using an email list this semester to communicate pertinent messages to everyone in the class. I will put together the list of email addresses in the first two weeks of class. It is the student's responsbility to ensure that they watch for and read any messages throughout the semester. In addition, this web page will continually be updated with the class schedule, resources, and other information.

Late Turn-in Policy

The penalty for late assignments will be -10% per day (determined on a 24-hour basis relative the due-time, which is the start of class ), down to a minimum of 50% (you can still get 1/2 credit if you turn it in by the end of the semester).

Exams

There will be six homeowrk assignments, and several quizzes which will be given randomly in class.
There will be two mid-term exams (approximately in the end week of February and the early week of April) plus a comprehensive final.

Grades will be determined by the percentage of total points earned during the course of the semester. The total points will be computed according to the following approximate weighting scheme, though it is subject to slight adjustment as appropriate:

Homework Assignment 30%
Two Midterm Exams 30%
Final Exam 20%
Quiz 20%

Grade Curving

The top 30% of students will get an A.
The next 15% will get a A- or B+.
The next 35% will get a B or B-.
The next 15% will get a C+ or C.
If you are in the lowest 5%, you will probably end up with a D+,D or F.

Attendance Policy

Lecture attendance is encouraged, but will not be used for grades. Unavoidable absences are understood, but each student is responsible for any missed material. For excused absences, an opportunity will be provided to make up any graded work that was missed. For unexcused absences, a grade of zero will be assigned for in-class assignment. Missed exams will be rescheduled without penalty for an excused absence, or with a 25% penalty if the absence is not excused. If you are going to be absent when an assignment is due you should try to turn in the assignment early. If that is not possible, be sure to include a request for an extended turn-in time in your e-mail.

To request approval of an absence or late turn-in, send me an e-mail explaining the reason prior to the class or due date. Tell me if you believe it is a university excused absence. If advance notification is not possible (e.g. unexpected illness) send the e-mail within 48 hours of the absence and be sure to explain why you were not able to notify me in advance. For illness, follow-up the e-mail by submitting a note from a doctor or clinic to my office.

Miscellaneous Notes

All students are covered by Academic Honor Code. Do not copy anybody else's homework assignments, exams, quizes, source codes, and any material used in previous semesters. You are welcome to talk with each other about homework programs unless otherwise specified, but do not turn in syntactically similar work. Cheating will be dealt with according to the university's policies on academic integrity.

If you have a documented disability and will need accomodations in this class, please speak with me privately early in the semester so I may be prepared to meet your needs. If you have not already registered with Disability Services for Students, contact the office at 999-7411. You must be registered with DSS before I can provide accommodations.


Tentative Schedule

The following is a planning schedule. It may be modified as necessary during the semester. Students will be expected to have some familiarity with the material in the schedule at the beginning of the lecture.

Week of Topic Forouzan and Gilberg
1/13 Introduction.
1/20 Basic Unix Commands Handout
1/27 Solving Problems on Computers. Ch 1.5
2/3 Solving Problem by C - An Overview Ch 1, Ch 2
2/10 Operators and Expressions Ch 3.1-3.4, 5.1
2/17 Basic Data Types Ch 2.4, 3.5, 5.4
2/24 Review and Midterm 1.
3/2 Flow of Control Ch 5, 6
3/9 Functions Ch 4
3/16 Spring Break .
3/23Pointers Ch 9
3/30Review and Midterm 2.
4/6Arrays and Strings Ch 8, 11, 10.1-10.4
4/13Stuctures Ch 12
4/20File I/O. Ch 13
4/27 Review and Final Exam .


Calendar

Details about lectures, homework assignments, exams etc. are added here.

Monday Tuesday Wednesday Thursday Friday




1/16
Go over syllabus.
1/17
1/18
What is computer science?
Computer organization.
Introduction to Computer Science.
1/21
Martin Luther King Day (no class).
1/22

1/23
Useful Linux commands.
Basic Computer Skills.
VI Manual.
Pico Manual.
Summary of Linux Commands.
Dr. Massingill's Unix/Linux links.
1/24
Last day for Add/Drop.
1/25
Solving Problem on Computers (Ch 1.5).
Modular Design.
Algorithm Development.
Software Life Cycle.
1/28
Quiz 1 key: Calculating Travel Time.
Programming in C - an overview (Ch 1, 2, 3).
Why C?
Lexical elements.
1/29
1/30
Compilations.
The Hello World Program.
Preprocessor directives.
Main function.
1/31
2/1
Quiz 2 key.
Algorithm for Hesperus.
The Hesperus Program.
Declaration, assignment and initialization.
HW1 Assignment.
travel.c (the initial version).
Homework Instructions.
2/4
Formatted I/O (scanf and printf).
How to solve HW1?
The lab starts from today: 4:30-6:30pm, 228.
2/5
2/6
Operators and expressions (Ch 3.1-3.4, 5.1).
Precedence and associativity.
Increment and decrement operators.
2/7
2/8
Relational and logical operators.
The comma operator.
The conditional operator.
Expressions.

Monday Tuesday Wednesday Thursday Friday
2/11
HW1 is due.
Quiz 3 key.
Basic Data Types (Ch 2.4, 3.5, 5.4).
char.
char vs. int.
All data types defined by the C standard.
HW2 Assignment.
2/12
2/13
int, float, double.
2/14
2/15
Compile-time operator sizeof.
Coversions.
Cast.
How to solve HW2?
2/18
Mid-term Exam 1 Review.
Mid-term1 Example Questions.
2/19
2/20
Mid-term1 Key.
2/21
2/22
Flow of control (ch 5, 6).
Selection.
If statement.
An example program of if-else: Calculating Salary.
2/25
HW2 is due.
An example program of if-else ladders: Calculating Bonus.
Switch statement.
An example program of switch: Spelling Checking.
Iteration.
For loop.
HW3 assignment.
2/26
2/27
While loop.
Do-while loop.
2/28
2/29
No class.
3/3
Quiz 4.
How to solve HW3?
3/4
3/5
An example of nested for: Three-layer Nested For.
Jump.
Break statement.
An example of break: Break a For Loop.
Another example of break: Break a Nested For Loop.
Continue statement.
An example of continue: Shifting Characters.
3/6
3/7
HW3 is due.
Functions (Ch 4).
Function definition.
Function variables.
An example program of using Local Variables in One Function.
An example program of using Local Variables in Multi-Function.
An example program of using Global Variables in Multi-Function.

Monday Tuesday Wednesday Thursday Friday
3/10
No class.
3/11
3/12
No class.
3/13
3/14
HW4 assignment.
Function parameters.
Function scope.
Function prototypes.
An example program of Call By Value.
3/17
Spring Break (no class).
3/18
3/19
Spring Break (no class).
3/20
3/21
Spring Break (no class).
3/24
HW4 Design.
Pointers (Ch 9).
Why and what?
3/25
3/26
Quiz 5 key.
Pointer Operators.
Pointer Assignment.
An example program of Pointer Assignment.
3/27
3/28
HW4 is due.
Pointer Initialization.
Pointer Arithmetic.
Call By Reference.
An example program of CBR: Swapping Two Integers.
Last day for Withdraw.
HW5 Assignment.
3/31
HW5 Design.
Sample code of applying CBR in HW5 days.c.
4/1
4/2
Mid-term2 review.
4/3
4/4
Mid-term2.

Monday Tuesday Wednesday Thursday Friday
4/7
Mid-term2 key.
4/8
4/9
HW5 is due.
Arrays and Strings [Ch 8 (Arrays), Ch 11 (Strings), Ch 10.1-10.4 (Arrays & Pointers)].
Array Definition.
Array Initialization.
Relationship Between Arrays and Pointers.
4/10
4/11
HW6 assignment.
Passing Arrays to Functions.
An example program of Passing Array to Fucntions (CBR) .
Dynamic Memory Allocation.
An example program of Dynamic Memory Allocation .
4/14
No class.
4/15
4/16
No class.
4/17
4/18
No class.
4/21
Quiz 8 (Arrays).
Strings.
String-Handling Functions.
An example program of using String Handling Functions .
4/22
4/23
Structures (Ch. 12).
Structure declaration.
Structure assignment.
An example program of Structure Assignment .
4/24
4/25
HW6 is due.
Passing Structures to Fucntions.
An example program of Passing Structures to Functions (CBV) .
Structure pointers.
An example program of Passing Structures to Functions (CBV & CBR) .
4/28
Final exam review.
Quiz 8 Key.
Final due day for all assignments by the end of the class.
4/29
4/30
Final Exam.
5/1
5/2
5/5
5/6
5/7
5/8
5/9


Last updated: Tuesday, Jan. 15, 2008 by Yu Zhang.