intro

advertisement
COMP152
Object-Oriented Programming and
Data Structures
Spring 2011
Slide 2
Math and CS

From ‘calculus’, get ‘programming fundamentals’





Sequence, dynamic procedure
Euclid  a process or an algorithm  iteration
Approximation of a real  iteratively
‘bracket’ the solution of a polynomial  iteration
Recurrent sequence u_{n+1} = f(u_n)  ‘recursion’
 Recurrent
sequent is ‘more expressive’, but no ‘close-form’ solution
 ‘convergence’ for math  ‘termination’ of a recursive procedure or a loop
 Fixed-point theorem  important for ‘recursion’ to finish
 Invariance  proof of correctness of a ‘loop’

From ‘algebra’, get ‘object-oriented programming’




‘algebra’ comes later than ‘calculus’
About ‘categorization’
Look for ‘general rules’ for the same objects
Group, ring, and fields: set of elements and operators


element sets  class
operators  operators
Slide 3
 Europe:
more mechanical, so is applied math,
informatics,
Latin: computare, to count (counter  compter)
 Calcul  calculus

 US:
with AI, with an anthropological aspect
Slide 4
Lectures


Instructor: Long QUAN
Lectures:




L2: Mon & Wed 10h—11h50
Web site: http://www.cse.ust.hk/~quan/comp152/index.html
 Lecture notes and tutorial material
 Assignments, test cases and solutions
 Download course material before class
Tutorials:
 2A (Mon, 1330-1420)
 2B (Fri, 1400-1450
 2C (Thur, 1800 1950)
Labs



2A (Tue 1330-1520)
2B (Thur 1800-1950)
2C (Wed 1300-1450)
Slide 5
Textbook

Main book:

ADTs, Data Structures, and Problem Solving with
C++, Prentice Hall, Larry Nyhoff
 My

‘bible’:
The C++ Porgramming language, Addison Wesley,
Stroustrup --- creator of C++
Slide 6
Grading Scheme
 Grading
is based on

1 Written Assignments (9%)
 3 Programming Assignments (5+10+10%=25%)
 11 Lab exercises (11*1% = 11%)
 Midterm Examination (20%)
 Final Examination (35%)
The
final has to be consistent with the overall score
If you perform well in the final, you may not fail the course
If you perform poorly in the final, you may not get an A
Slide 7
Plagiarism Policy
 1st
Time: both get 0
 2nd Time: both get 0 + one full downgrade
 3rd Time: FAIL
 Midterm or Final: an automatic FAIL
You are encouraged to collaborate in study groups.
But, you cannot copy or slightly change other students’
solutions or codes.
The detection of plagiarism is computerized!
Slide 8
Course Overview
 A fundamental
computer science course
- Essential for programming
- Essential for advanced courses, e.g. 271
 A challenging course, which needs
- Mathematical and logic thinking
- Programming
 104,151,171 have been revamped to become
(the new) 152!
Slide 9
Course Prerequisite

COMP104






Basic mathematical skills


Need to know C and C++
PC programming environment
Good programming skills
Translate pseudo-codes into codes
Speedy review in the 1st week
Solving recursive equations, manipulation of symbols, etc.
Computer architecture

Pointers, storage, memory access, etc.
Slide 10
Course Outline
C++ review (1 week)
 OOP1: concept and classes (2 weeks)
 Data structure 1: Lists, stacks, and queues (2 weeks)
 Generic programming (2 weeks)
 Standard template library (STL) (1 week)
 OOP2: inheritance, polymorphism and virtual functions
(2 weeks)
 Data structure 2: binary trees (2 weeks)
 Hashing (1 week)
 Sorting (option, 1 week)

10
Slide 11
Overall Goal of the Course
 From
programmer to architect
 Learn to solve problems
 Algorithms and Programming go hand in hand
 Learn to analyze your solutions
Slide 12
Lecture Format

Lectures:

Slides are available before class
Print in ‘graylevel’ as ‘handouts’!!!
Constantly updated, only minorly!!!



Tutorials




It is important to attend the lectures (because not all material
and concepts are covered in slides)
If you miss any lectures, learn from your friends
Supplement the lectures
Some important exercises
Welcome to attend other tutorials if you miss the your signed
session
Programming and homework assignments

More rigorous problems to consolidate your knowledge
Slide 13
Assignments

Written assignments





Due by time specified
Contact TAs directly for re-grades
Re-grade requests will only be entertained within 1 week after
the homework are handed back
Late policy: 20% reduction, allows only one day late.
Programming assignments





Due by time specified
Run on PC
Submit it using CASS
Re-grade policy will be announced
Late policy : 20% reduction, allows only one day late.
Slide 14
Midterm and Final Examinations
Sat. 2nd April
 Final: TBA
 Closed-book, closed-notes
 No make-ups will be given
 Midterm:

Unless under very unusual circumstances, with
letters of proof
 Instructor informed beforehand
Download