COURSE MECHANICS. Welcome! CSE 332 Data Abstractions: Introduction and ADTs. Concise to-do list. Today in Class. Instructor: Kate Deibel

Similar documents
CSE 332: Data Abstractions. Ruth Anderson Spring 2014 Lecture 1

CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues. Lauren Milne Summer 2015

CSE373: Data Structures and Algorithms Lecture 1: Introduc<on; ADTs; Stacks/Queues

CSE 332: Data Structures. Spring 2016 Richard Anderson Lecture 1

CSE 326 Team. Today s Outline. Course Information. Instructor: Steve Seitz. Winter Lecture 1. Introductions. Web page:

Adam Blank Lecture 1 Winter 2017 CSE 332. Data Abstractions

CPSC 221: Algorithms and Data Structures ADTs, Stacks, and Queues

CPSC 221: Algorithms and Data Structures Lecture #1: Stacks and Queues

CSE 373 Data Structures and Algorithms. Lecture 2: Queues

CPSC 221: Algorithms and Data Structures Lecture #0: Introduction. Come up and say hello! Fibonacci. Fibonacci. Fibonacci. Fibonacci. (Welcome!

CSE 240 Introduction to Computer Architecture

CS 206 Introduction to Computer Science II

CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up. Nicki Dell Spring 2014

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims

CSE 373: Data Structures and Algorithms

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

COMP251: Algorithms and Data Structures. Jérôme Waldispühl School of Computer Science McGill University

CSE 417 Practical Algorithms. (a.k.a. Algorithms & Computational Complexity)

CSE 373: Data Structures and Algorithms

CSE 373: Data Structures and Algorithms

Database Management System Implementation. Who am I? Who is the teaching assistant? TR, 10:00am-11:20am NTRP B 140 Instructor: Dr.

CS 4349 Lecture August 21st, 2017

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

CS W3134: Data Structures in Java

Programming and Data Structures Prof. N.S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras

Postfix (and prefix) notation

CSE 332: Data Structures & Parallelism Lecture 10:Hashing. Ruth Anderson Autumn 2018

Data Structures and Algorithms

Lecture 6. COMP1006/1406 (the OOP course) Summer M. Jason Hinek Carleton University

CSE373: Data Structures & Algorithms Lecture 23: Course Victory Lap. Kevin Quinn Fall 2015

CS 206 Introduction to Computer Science II

Welcome to CS 241 Systems Programming at Illinois

CS 241 Data Organization. August 21, 2018

CSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education

CS 240 Fall Mike Lam, Professor. Just-for-fun survey:

Lecture 2: Implementing ADTs

CSE 114, Computer Science 1 Course Information. Spring 2017 Stony Brook University Instructor: Dr. Paul Fodor

Welcome to CS 241 Systems Programming at Illinois

CSE 240 Introduction to Computer Architecture

CSE 373: Data Structures and Algorithms

CSE373: Data Structure & Algorithms Lecture 18: Comparison Sorting. Dan Grossman Fall 2013

CS 106B Lecture 5: Stacks and Queues

Topics. Trees Vojislav Kecman. Which graphs are trees? Terminology. Terminology Trees as Models Some Tree Theorems Applications of Trees CMSC 302

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1, 2, and 3, Spring 2018

Syllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)

Lecture 1: Welcome! CSE 373: Data Structures and Algorithms CSE WI - KASEY CHAMPION 1

CSCI 204 Introduction to Computer Science II. Lab 6: Stack ADT

ECE Object-Oriented Programming using C++ and Java

COMP Analysis of Algorithms & Data Structures

BOSTON UNIVERSITY Metropolitan College MET CS342 Data Structures with Java Dr. V.Shtern (Fall 2011) Course Syllabus

Reasoning About Programs Panagiotis Manolios

Lecture 17: Hash Tables, Maps, Finish Linked Lists

cs Java: lecture #6

Introduction to Data Structures

Lecture 1: CSE 373. Data Structures and Algorithms

Syllabus CS 301: Data Structures Spring 2015

Stacks Fall 2018 Margaret Reid-Miller

Implementing Hash and AVL

CSC 111 Introduction to Computer Science (Section C)

378: Machine Organization and Assembly Language

3137 Data Structures and Algorithms in C++

CPSC 2380 Data Structures and Algorithms

CS2013 Course Syllabus Spring 2018 Lecture: Mon/Wed 2:00 P.M. 2:50 P.M. SH C259 Lab: Mon/Wed 2:50 P.M. 4:00 P.M. SH C259

CSC 443: Web Programming

CENG 707 Data Structures and Algorithms


CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS 61B Summer 2005 (Porter) Midterm 2 July 21, SOLUTIONS. Do not open until told to begin

Introduction to Database S ystems Systems CSE 444 Lecture 1 Introduction CSE Summer

CSE 373: Data Structures and Algorithms

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

COMP 2150 CS 2: Object-Oriented Programming and Data Structure Fall 2018 Dr. James Yu

COMP 117: Internet-scale Distributed Systems Lessons from the World Wide Web

CS 135 Lab Assignments Week 1

Announcements. 1. Forms to return today after class:

CSC148H Week 3. Sadia Sharmin. May 24, /20

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

PA3 Design Specification

[301] Introduction. Tyler Caraza-Harter

Stacks and Queues

CMPS 182: Introduction to Database Management Systems. Instructor: David Martin TA: Avi Kaushik. Syllabus

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

COMP Data Structures

CS2013 Course Syllabus Spring 2017 Lecture: Friday 8:00 A.M. 9:40 A.M. Lab: Friday 9:40 A.M. 12:00 Noon

Introduction to Database S ystems Systems CSE 444 Lecture 1 Introduction CSE Summer

Welcome to CSE 326: Data Structures & Algorithms

CSE 333 Lecture 1 - Systems programming

Introduction to Computer Systems

CSE 373 OCTOBER 11 TH TRAVERSALS AND AVL

12 Abstract Data Types

Today s Outline. CSE 326: Data Structures Asymptotic Analysis. Analyzing Algorithms. Analyzing Algorithms: Why Bother? Hannah Takes a Break

CSCE 441 Computer Graphics Fall 2018

CS 240 Fall 2015 Section 004. Alvin Chao, Professor

COMP Data Structures

VE281 Data Structures and Algorithms. Introduction and Asymptotic Algorithm Analysis

CS 241 Data Organization using C

Physics 2660: Fundamentals of Scientific Computing. Lecture 5 Instructor: Prof. Chris Neu

Introduction to Programming System Design CSCI 455x (4 Units)

University of Waterloo Department of Electrical and Computer Engineering ECE250 Algorithms and Data Structures Fall 2014

Transcription:

CSE 332 Data Abstractions: Introduction and ADTs Kate Deibel Summer 2012 Welcome! We have 9 weeks to learn fundamental data structures and algorithms for organizing and processing information Classic data structures and algorithms: queues, trees, graphs, sorting, etc. Rigorously analyze their efficiency Determine when to use them Parallelism and concurrency (!) June 18, 2012 CSE 332 Data Abstractions, Summer 2012 1 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 2 Today in Class Course mechanics What this course is about And how it fits into the CSE curriculum What is an ADT? Review of Stacks and Queues Mystery Topics!? Concise to-do list In next 48 hours, you should: Adjust class email-list settings Do homework 0 (worth 5 bonus pts) Read all course policies Read/skim Chapters 1 & 3 of Weiss book Relevant to Project 1, due next week Will start Chapter 2 on Wednesday June 18, 2012 CSE 332 Data Abstractions, Summer 2012 3 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 4 Socket wrench scalpel snarky comments COURSE MECHANICS Instructor: Kate Deibel Not me but my cute calico Susie PhD in CSE (2011), University of Washington Research: Digital literacies Educational Technologies Assistive technologies Disability and education Office: CSE 210 Hours: TBD or drop-by E-mail: deibel@cs or @uw June 18, 2012 CSE 332 Data Abstractions, Summer 2012 5 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 6 1

Teaching Assistant: David Swanson Let's let him introduce himself E-mail: swansond@cs D-E-I-B-E-L Pronunciation: DIE-BULL Spelling: Decibel minus the c Not David but Susie again. Isn't she cute? June 18, 2012 CSE 332 Data Abstractions, Summer 2012 7 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 8 When in doubt Consult the course webpage http://www.cs.washington.edu/education/ courses/cse332/12su/ Or, if you want the quicker URL: http://www.cs.washington.edu/332 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 9 Communication Course email list: cse332a_su12@u You are already subscribed (your @uw e-mail) You must get announcements sent there Fairly low traffic Course staff: cse332-staff@cs or Kate's and David's individual emails Discussion board For appropriate discussions; TAs will monitor Optional but can be enlightening Anonymous feedback link If you don t tell me (good or bad), I don t know June 18, 2012 CSE 332 Data Abstractions, Summer 2012 10 Course meetings Lecture (Kate) Materials posted usually before class (95% guarantee) to aid your note-taking Lectures focus on key ideas & proofs Some interactive problem-solving Section (David) Often focus on software (Java features, programming tools, project/hw issues) Reinforce key issues from lecture Answer homework questions, etc. An important part of the course (not optional) NOTICE!!! Locations for one or more quiz sections will likely change Goal is to have both in the same room or at least the same building Will announce over course e-mail list before Thursday Website will update when we know June 18, 2012 CSE 332 Data Abstractions, Summer 2012 11 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 12 2

Office Hours David's Office Hours TBD but will students for time Kate's Office Hours TBD after David's are set I frequently hold open-door hours: If my door is open, come on in! Course materials Textbook: Weiss 3rd Edition in Java Good read, but only responsible for lecture/section/hw topics Will assign homework problems from it 3rd edition improves on 2nd, but we ll support the 2nd Core Java book: A good Java reference (there may be others) Don t struggle Googling for features you don t understand Same book recommended for CSE331 Parallelism / concurrency units use a free notes written by Dan Grossman (linked on website) June 18, 2012 CSE 332 Data Abstractions, Summer 2012 13 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 14 Course Work 8 written/typed homeworks (25%) Due at end of lecture the day it is due No late homeworks accepted 3 programming projects (25%) Projects have phases (parts) First phase of Project 1 due next week (TBD) Use Java (see this week s section) Two 24-hour late-days for the quarter Midterm Exam (20%) Final Exam (30%) Collaboration & Academic Integrity Read the course policy very carefully to understand how you can and cannot get/provide help to/from others Be proactive and always explain (when you submit) any unconventional action on your part when it happens June 18, 2012 CSE 332 Data Abstractions, Summer 2012 15 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 16 Respect Policy If you respect me, I will respect you I am here to teach you and help you learn about data abstractions I make a promise to have good lectures, polished assignments, etc. on time and in good humor In return, you should be Respectful in lab and lecture Do not cheat Academic Accommodations (formal) To request personal academic accommodations due to a disability, please contact Disability Resources for Students: 448 Schmitz, 206-543-8924 (or 206-543- 8925 for TTY). If you have a letter from DRS indicating that you have a disability which requires academic accommodations, please present the letter to me so we can discuss how to meet your needs for this course. June 18, 2012 CSE 332 Data Abstractions, Summer 2012 17 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 18 3

Academic Accommodations (proper) My goal is for you to learn productively If you have problems, ask me or a TA Accommodations: We are not mean We understand that life happens beyond this class, this major, this university, We can make reasonable accommodations for individual students This offer is open for everyone Just talk to us Unsolicited Advice Get to class on time! Learn this stuff You need it for so many later classes/jobs Falling behind only makes more work for you Have fun So much easier to be motivated and learn Get used to my bad jokes Yes, they really are that bad If you don't laugh, they just get worse June 18, 2012 CSE 332 Data Abstractions, Summer 2012 19 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 20 It's not about teaching penguins to limbo WHAT THIS CLASS IS ABOUT? Data Structures + Threads About 70% of the course is a classic data-structures course Timeless, essential stuff Core data structures and algorithms that underlie most software How to analyze algorithms Plus a serious first treatment of programming with multiple threads Parallelism: Use multiple processors Concurrency: Access to shared resources Connections to the classic material June 18, 2012 CSE 332 Data Abstractions, Summer 2012 21 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 22 Where 332 fits required CS required CompE required not required pre-req co-req or pre-req 331 Sw Design / Impl 311 Foundations I 351 Hw/Sw Interface 390A Tools EE205 Signal Conditioning (or EE215) 332 Data Abstractions 352 Hw Design / Impl 312 Foundations II 344 Data Management 341 Programming Languages STAT391 333 Systems Programming Most common pre-req for 400-level courses Essential stuff for many internships too! June 18, 2012 CSE 332 Data Abstractions, Summer 2012 23 What 332 is about Deeply understand the basic structures used in all software Understand the data structures and trade-offs Analyze the algorithms that use them (math!) Learn how to pick the right thing for the job Experience the purposes and headaches of multithreading Practice design, analysis, and implementation The elegant interplay of theory and engineering at the core of computer science June 18, 2012 CSE 332 Data Abstractions, Summer 2012 24 4

Goals Be able to make good design choices as a developer, project manager, etc. Reason in terms of the general abstractions that come up in all non-trivial software (and many non-software) systems Be able to justify and communicate your design decisions Views on this course Prof. Steve Seitz (graphics): 100-level and some 300-level courses teach how to do stuff 332 teaches really cool ways to do stuff 400 level courses teach how to do really cool stuff Prof. James Fogarty (HCI): Computers are fricking insane Raw power can enable bad solutions to many problems This course is about how to attack non-trivial problems where it actually matters how you solve them June 18, 2012 CSE 332 Data Abstractions, Summer 2012 25 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 26 Views on this course Prof. Dan Grossman (prog. langs.): Three years from now this course will seem like it was a waste of your time because you can t imagine not just knowing every main concept in it Key abstractions computer scientists and engineers use almost every day A big piece of what separates us from others My View on the Course This is the class where you begin to think like a computer scientist You stop thinking in Java or C++ code You start thinking that this is a hashtable problem, a linked list problem, etc. You realize that little assumptions make big differences in performance You realize there is no absolutely best solution for a problem June 18, 2012 CSE 332 Data Abstractions, Summer 2012 27 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 28 Data structures, ADTs, etc. (sorry, no weird joke here) TERMINOLOGY Data structures [Often highly non-obvious] ways to organize information to enable efficient computation over that information Key goal of the next lecture is introducing asymptotic analysis to precisely and generally describe efficient use of time and space A data structure supports certain operations, each with a: Meaning: what does the operation do/return Performance: how efficient is the operation Examples: List with operations insert and delete Stack with operations push and pop June 18, 2012 CSE 332 Data Abstractions, Summer 2012 29 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 30 5

Trade-offs A data structure strives to provide many useful, efficient operations But there are unavoidable trade-offs: Time performance vs. space usage Getting one operation to be more efficient makes others less efficient Generality vs. simplicity vs. performance That is why there are many data structures and educated CSEers internalize their main trade-offs and techniques And recognize logarithmic < linear < quadratic < exponential Terminology Algorithm A high level, language-independent description of a step-by-step process Abstract Data Type (ADT) Mathematical description of a thing with set of operations Data structure A specific family of algorithms for implementing an ADT Implementation of a data structure A specific implementation in a specific language on a specific machine (both matter!) June 18, 2012 CSE 332 Data Abstractions, Summer 2012 31 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 32 Example: Stacks The Stack ADT supports operations: isempty: have there been same number of pops as pushes push: takes an item pop: raises an error if isempty, else returns most-recently pushed item not yet returned by a pop (possibly more operations) A Stack data structure could use a linkedlist or an array or something else, and associated algorithms for the operations One implementation is in the library java.util.stack The Stack is a Useful Abstraction It arises all the time in programming (e.g., see Weiss 3.6.3) Recursive function calls Balancing symbols (parentheses) Evaluating postfix notation: 3 4 + 5 * Clever: Infix ((3+4) * 5) to postfix conversion We can code up a reusable library We can communicate in high-level terms Use a stack and push numbers, popping for operators rather than, create a linked list and add a node when June 18, 2012 CSE 332 Data Abstractions, Summer 2012 33 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 34 The Queue ADT Operations create destroy enqueue dequeue is_empty enqueue G F E D C B dequeue A Just like a stack except: Stack: LIFO (last-in-first-out) Queue: FIFO (first-in-first-out) Just as useful and ubiquitous Get in line right now for the best offers! LET'S MAKE A QUEUE DATA STRUCTURE! June 18, 2012 CSE 332 Data Abstractions, Summer 2012 35 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 36 6

Circular Array Queue Data Structure Linked List Queue Data Structure Q: 0 size - 1 b c d e f front enqueue(x) { Q[back] = x; back = (back + 1) % size back dequeue() { x = Q[front]; front = (front + 1) % size; return x; What if queue is empty? Enqueue? Dequeue? What if array is full? How to test for empty? What is the complexity of the operations? Can you find the kth element in the queue? June 18, 2012 CSE 332 Data Abstractions, Summer 2012 37 b c d e f front enqueue(x) { back.next = new Node(x); back = back.next; dequeue() { x = front.item; front = front.next; return x; back What if queue is empty? Enqueue? Dequeue? Can list be full? How to test for empty? What is the complexity of the operations? Can you find the k th element in the queue? June 18, 2012 CSE 332 Data Abstractions, Summer 2012 38 Circular Array vs. Linked List Array: May waste unneeded space or run out of space Space per element excellent Operations very simple / fast Constant-time access to kth element For operation insertatposition, must shift all later elements Not in Queue ADT List: Always just enough space But more space per element Operations very simple / fast No constant-time access to kth element For operation insertatposition must traverse all earlier elements Not in Queue ADT The Stack ADT Operations: create destroy push pop top is_empty A Can also be implemented with an array or a linked list This is Project 1! Like queues, type of elements is irrelevant Ideal for Java s generic types (section and Project 1B) B C D E F F E D C B A June 18, 2012 CSE 332 Data Abstractions, Summer 2012 39 June 18, 2012 CSE 332 Data Abstractions, Summer 2012 40 Conclusions Welcome again! This will be a fun class. Read Chapter 1-3 for Wednesday Chapter 1 is about Java Chapter 3 is what we talked about today Chapter 2 is discussed on Wednesday June 18, 2012 CSE 332 Data Abstractions, Summer 2012 41 7