Intro
Intro
Fall 2017
Slide 2
Lectures
Instructor: Long QUAN
Lectures:
Tuesday & Thursday 11h30am – 1h20pm , room 2404
Web site:
(https://course.cse.ust.hk/comp2012h)
http://www.cse.ust.hk/~quan/comp2012h/index.html
Lecture notes
Assignments, test cases and solutions
Download course material before class
Labs
Slide 3
Textbook
Main book:
ADTs, Data Structures, and Problem Solving with
C++, Prentice Hall, Larry Nyhoff
My reference book:
The C++ Porgramming language, Addison Wesley,
Stroustrup --- creator of C++
Slide 4
Grading Scheme
Grading is based on
3 Programming Assignments (8+9+8%=25%)
11 Lab exercises (10%), 1% each, and the best 10
Midterm Examination (25%)
Final Examination (40%)
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 5
Plagiarism Policy
1st Time: both get 0
2nd Time: both get 0 + one full downgrade
3rd Time: FAIL
Midterm or Final: an automatic FAIL
Course Overview
A fundamental computer science course
- Essential for programming
- Essential for advanced courses
A challenging course, which needs
- Mathematical and logic thinking
- Programming
Slide 7
Course Prerequisite
COMP104
Need to know C and C++
PC programming environment
Good programming skills
Translate pseudo-codes into codes
Speedy review in the 1st week
Basic mathematical skills
Solving recursive equations, manipulation of symbols, etc.
Computer architecture
Pointers, storage, memory access, etc.
Slide 8
Course Outline
C++ review (1 week)
Recursions and algo analysis (1 week)
Sorting (1 week)
Lists (1 week)
OOP1: concept and classes (2 weeks)
Data structures: stacks, and queues (1 weeks)
Midterm
8
Slide 9
Lecture Format
Lectures:
Slides are available before class
Print
in ‘graylevel’ as ‘handouts’!!!
Constantly updated, only minorly!!!
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
Labs
Compulsary!
Weekly programming practice
Programming assignments
More rigorous problems to consolidate your knowledge
Manipulation of polynomials
Linked list data structure
Class-based implementation
STL and advanced functions
Bonus? Anything beyond the three assignments
Slide 11
Assignments
Programming assignments
Due by time specified
Run on PC
Submit it using CASS
Re-grade policy will be announced
Late policy : allows only one day late for at most
one assignment, 2 days late is not accepted
Slide 12
C, Fortran, Pascal,
Lisp, scheme, …
Python
interpreted, high-level, efficiency
structural, object-oriented
functional in Lisp tradition, dynamic typing and binding, garbage collection
(JavaScript)
Interpreted, high-level, dynamic, weakly typed, object-based, multi-paradigm
Java
C++
…
Slide 14
operation
3 program structures Functions on objects (member) functions Algorithms
(assignment,
conditional,
iteration)
C, Pascal C++, Java
Programming paradigms
Procedural programming
Functional programming
Object-oriented programming
Slide 16
Procedural programming
An (ordered) sequence of ‘procedures’ or
‘functions’ or meta-instructions
Three instructions
Assignment
Conditional
iteration
Slide 17
procedural programming:
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 sequentce 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 19
Algorithm analysis
Sorting algorithms