Tuesday
Agenda
- Sign in - Please include your preferred name
- Introduction, Syllabus
- Course Goals
Who should take this course
- Took CS21 or placement exam
- Potential CS major/minors
- Pre-req for upper level CS
- Interested in solving complex problems with algorithms and data structures
Big course questions
- Given a problem
- how do we solve it computationally
- what method is best
- is our method correct
- How do we compare methods?
- What is the best way to organize and store data
- may depend on application
- Abstract Data Type (ADT):
- describes operations to support on data but not how to implement
- What are best ways to implement ADTs?
Other course Goals
- Understand principles of OOP - expand on CS21
- Implement OOP in C++
- C++ is huge, evolving. We’ll pick a subset suitable for this course
- Learn common and powerful DS and common Operations
- Learn how to apply DS & A to solve problems of moderate complexity
Student responsibilities
- Attend and participate (labs and lecture)
- start labs early
- seek help early and Often
- maintain integrity
What is CS35
- CS35: Data Structures and Algorithms
- Algorithm: A step-by-step description of how to solve a problem
- sort a list of numbers
- find cheapest flight from PHL to YVR
- Data Structure: Specification for storage, organization of data
- examples from cs21?
- Missing
- give directions
- rank restaurants
- CS35 as core CS
- Often several ways to do things
- Common patterns
- Faster ways save money, do more
- All of CS builds off DS & A
- Algorithms are program building blocks
- All programs use, need to structure data
Why C++?
- Good to know multiple languages
- each has benefits, drawbacks, common applications
- expand problem solving skils
- learn which programming elements are shared/unique
- Python may not be very efficient for large tasks
- good for beginners
- can do simple things fast
- C++ allows more low level accesses and more power/control to programmer regarding how to:
- store data
- manage memory
- pass information/data
- downside: more responsibility
Exercise
Python seriesSum vs C++
Program Attributes
- Translator
- Python - Interpreted
- C++ - Compiled
- Types
- Python - Dynamic typing
- C++ - Static Typing
Thursday
Announcements
Clicker Testing
You should have your clickers by the end of this week.
Sample Questions
C++ code basics
I've added the program demo.cpp to your examples-<user> repo. Feel free to experiment with this code and practice C++. You can get the recent updates at any time by going into your ~/cs35/examples folder and running git pull
cd ~/cs35/examples
git pull
cd week-01
If you get some strange
git error, try seeing if any of the messages at
Understanding Git Status help. If your case is missing, feel free to post to
Piazza
How do I compile/run this demo?
cd ~/cs35/examples
cd week-01
???
Demo Topics:
- Types
- Arithmetic ops
- Terminal I/O: cout, cin
- Branching and Decision structures
- Loops
- Functions
To come: