Link
Welcome to CSE 332
Why data structures and parallelism, the manner in which learning occurs, and a first-look at the technical foundations.
Kevin Lin, with thanks to many others.
1

Drive current progress (?) in society
Self-Driving Car (Waymo/Google), Delivery Drone (Hadas Bendel/Wikimedia)
2

Advance human knowledge
Simulation of millisecond protein folding (Voelz, Bowman, Beauchamp, Pande/Pande Lab), TIMELAPSE OF THE FUTURE: A Journey to the End of Time (melodysheep/YouTube)
3

Advance human knowledge
Parable of the Polygons (Vi Hart, Nicky Case); Fake News: A Survey of Research, Detection Methods, and Opportunities (Xinyi Zhou, Reza Zafarani/arXiv:1812.00315)
4

Support daily life
© Mapbox; © OpenStreetMap; Improve this map.
5

HuskyMaps
© Mapbox; © OpenStreetMap; Improve this map.
 Search HuskyMaps		︙
Autosuggest
Navigation Directions
Coordinating places, locations, and map data
6

Design, analyze, & use fast algorithms for managing big data
7
© Mapbox; © OpenStreetMap; Improve this map.
It’s not sufficient for an algorithm to “get the job done” when it takes so long to run that it’s practically unusable.

What are you most excited (or nervous) about learning?
8

The important points of a data structures course should not be the details of individual algorithms or representations.
9
The Future of CS 2 and Data Structures (Michael Clancy/OOPSLA)
What, then, are we really supposed to learn?

Students should also learn to identify efficiency constraints on problem solutions, to understand the tradeoffs between storing and recomputing information and the tradeoffs of using linked vs. contiguous storage to store it, and to identify appropriate data types whose implementations satisfy the problem requirements. Applications where students must wrestle with these issues are a necessary part of such a course.

The Manner in Which Learning Occurs
10

11
Self-Regulated Learning: Beliefs, Techniques, and Illusions (Bjork, Dunlosky, Kornell/Annual Review of Psychology 2013)

12
The Manner in Which Learning Occurs
Mastery
Traditional
Introduction
Lecture
Apply-level
Quiz section
Create-level
Good luck…
Class
Exam
There are multiple levels of content knowledge mastery.

13
The Manner in Which Learning Occurs
Mastery
Traditional
Active
Introduction
Lecture
Reading
Apply-level
Quiz section
Lecture
Create-level
Good luck…
Quiz section
There are multiple levels of content knowledge mastery.

Does active learning in lecture actually help?
Compare the learning of two identical sections of first-year college physics.
270 students in each section.
Same learning objectives.
Same class time: 3 hours of instruction over 1 week.
Same test at the end of the week.

Control.		Traditional lecture with a highly-experienced and highly-rated professor.
Experiment.	Inexperienced Ph.D student trained to use principles of effective teaching.
14
Improved Learning in a Large-Enrollment Physics Class (Deslauriers, Schelew, Wieman/Science)

15
Test of learning
Guess
Improved Learning in a Large-Enrollment Physics Class (Deslauriers, Schelew, Wieman/Science)
Clear improvement for the entire student population: everyone wins. In this study, there was no outside homework, quiz sections, reading, etc. In the real-world, the effect is typically less dramatic.

16
Feeling of learning
Measuring actual learning versus feeling of learning in response to being actively engaged in the classroom (Deslauriers et al./PNAS)
But students did not feel like they learned as much.

17
Feeling of learning
Measuring actual learning versus feeling of learning in response to being actively engaged in the classroom (Deslauriers et al./PNAS)
But students did not feel like they learned as much.

18
Feeling of learning
Measuring actual learning versus feeling of learning in response to being actively engaged in the classroom (Deslauriers et al./PNAS)
In traditional lectures, students knew they weren't being engaged. Yet, they felt they learned more.

19
In CSE?
Active learning increases student performance in science, engineering, and mathematics (Freeman et al./PNAS)

programming is […] about the iterative process of refining mental representations of computational problems and solutions and expressing those representations as code.
20
Programming, Problem Solving, and Self-Awareness: Effects of Explicit Guidance (Loksa et al./CHI ‘16)
Learning is uncomfortable because it occurs when you update your mental representation of a problem. This requires recognizing when an idea is not quite correct and then taking steps to amend it.

21
The Manner in Which Learning Occurs
Mastery
Traditional
Active
Introduction
Lecture
Reading
Apply-level
Quiz section
Lecture
Create-level
Good luck…
Quiz section
Homework?
There are multiple levels of content knowledge mastery.

A week in CSE 332 by the hours (11–14 total)
Reading (1.5)
Lecture (3)
Quiz section (1)
Homework (6–8)
Office Hours
Least
Most
Comfort with a topic
Peer Charrette (0.5–1.5)
22
Study Guide
Exam Studying

Learning
Community
Course Staff
23
Regardless of whether you want to work in industry, academia, non-profits, or contribute to the world in another way, any project of interesting scale will involve other people. Part of the experience of this course is about engaging productively with members of the course community.

Collaboration is required
Lecture will be like a traditional quiz section: solve problems in groups.
Earn exam points (!) for participation starting next week. Find a group this week.
Quiz sections will be collaborative. Earn exam points (!) for participation.
Peer Charrettes. Plan, debug, and study together with a peer. Effort-graded by your TA.
Final grades are not curved, i.e. they are not based on your relative performance.

Effort		Attending office hours, making progress on every homework, above & beyond
Participation	Participating in quiz section and asking questions on forum
Altruism		Helping other students, answering questions on forum
24

Limits of collaboration
Do not claim to be responsible for work that is not yours.
We really do catch people who violate the rule, because:
We also know how to search the internet for solutions.
We use data structures and algorithms to check your work.

All code you submit should be your own work, with a few permissions:
Receiving significant conceptual ideas towards a solution.
Using small snippets of code that you find online for solving tiny problems.
These must be cited with comments in your code.
25

cs.uw.edu/332
Questions?
26
Course schedule, policies, and staff introductions. The course website is your one-stop shop, but you’ll also receive major announcements via email notifications.

Abstract Data Types
27
All programs work with data in one way or another. A function takes input data (arguments) and transforms them into some output data (return value). How we organize this data governs the way we write programs.

Data Types
A variable’s data type (or simply type) determines its possible values and operations.
28
int course;
course = 33;
course = -33;
course = 3.14;
(33 + 2) == 35
String course;
course = "33";
course = "-33";
Possible values
course.equals(33)
Possible operations
course = "3.14";
("33" + "2").equals("332")
Cannot call equals
?: What is an example of an impossible value and an impossible operation for String?

Abstract Data Types (ADTs)
Java interfaces represent the software design concept of abstract data types.
An abstract data type is a data type that does not specify any one implementation.
Data structures implement ADTs.
Resizable array can implementList, Stack, Queue, Deque, PQ, etc.
Linked nodes can implementList, Stack, Queue, Deque, PQ, etc.
29
List ADT	A collection storing an ordered sequence of elements.
Each element is accessible by a zero-based index.
A list has a size defined as the number of elements in the list.
Elements can be added to the front, back, or any index in the list.
Optionally, elements can be removed.
?: Why not just use ArrayList all the time?

Hiding Program Complexity
Abstract data types hide implementation details from clients (users of ADTs).
Contract	Description of an ADT’s possible values and operations

What are the consequences of breaking the contract?
When might it be useful to know the implementation details of an ADT’s values or operations?
30
Implementer
Client
ADT
Q
Q1: What are the consequences of breaking the contract?








Q2: When might it be useful to know the implementation details of an ADT’s values or operations?

Hiding Program Complexity
31
A

Representation Invariants
Abstract data types hide implementation details from clients (users of ADTs).
Contract	Description of an ADT’s possible values and operations
Invariant	An assumption that the implementer needs to maintain
In an ArrayList, the i-th item of the list (ADT) is always stored at array index i (data structure). Give an example of an operation that is very slow on ArrayList.
32
Implementer
Client
ADT
Q
Q1: Give an example of an operation that is very slow on ArrayList.

Representation Invariants
33
A

Interfaces vs. Implementations
In Java, an interface is a data type that specifies what to do but not how to do it.
List: a collection storing an ordered sequence of elements.
A subtype of List must implement all methods required by the List interface.
ArrayList: Resizable array implementation of the List interface.
LinkedList: Doubly-linked implementation of the List interface.
34
List
ArrayList
LinkedList

Design Decisions
For every ADT, there are many data structures and algorithms that solve the problem.

This course will study data structures and algorithms as design decisions.
Running time, dependent on the input data.
Reusability vs. Specificity.
Robustness vs. Performance.
By evaluating, implementing, and defending designs, we become better computer scientists.
35
Extra Design Question: Dub Street Burgers is implementing a new system for ticket (i.e. food order) management. When a new ticket comes in, it is placed at the end of the line of tickets. Food is prepared in about the order requested, but some food orders take less time to prepare than others. As a result, some tickets may be fulfilled earlier than other tickets.

Let’s represent tickets as a list. Should we use an ArrayList or a LinkedList? Why?