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

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

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

Adam Blank Lecture 1 Winter 2017 CSE 332. Data Abstractions

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

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

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

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

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

CSE 373 Data Structures and Algorithms. Lecture 2: Queues

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

CSE 373: Introduction, ADTs, Design Decisions, Generics. Michael Lee Wednesday Jan 3, 2017

Announcements. 1. Forms to return today after class:

Lecture 1: CSE 373. Data Structures and Algorithms

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

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

CSE 240 Introduction to Computer Architecture

CSE 373: Data Structures and Algorithms

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

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

CSE 373 OCTOBER 11 TH TRAVERSALS AND AVL

3137 Data Structures and Algorithms in C++

Lecture 17: Hash Tables, Maps, Finish Linked Lists

CSE 344 JANUARY 3 RD - INTRODUCTION

CPSC 2380 Data Structures and Algorithms

Lab 7 1 Due Thu., 6 Apr. 2017

Operating Systems CMPSC 473. Introduction January 15, Lecture 1 Instructor: Trent Jaeger

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

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

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

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

CSE 373: Data Structures and Algorithms

CS W3134: Data Structures in Java

Data Structures and Algorithms

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

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

CS 206 Introduction to Computer Science II

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

Credit: The lecture slides are created based on previous lecture slides by Dan Zingaro.

WELCOME TO CSE 100! Advanced Data Structures in C++

CENG 707 Data Structures and Algorithms

Postfix (and prefix) notation

Menu. Class 1: Introduction. Staff. Course Structure and Expectations. Contacting Us. Contacting You

CISC 3130 Data Structures Spring 2018

378: Machine Organization and Assembly Language

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

PA3 Design Specification

CSE 373: Data Structures and Algorithms

CSE 332: Data Structures & Parallelism Lecture 3: Priority Queues. Ruth Anderson Winter 2019

CSE 504: Compiler Design

Advanced Programming Concepts. CIS 15 : Spring 2007

Data Structures and Algorithms

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

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

CSE 373: Data Structures and Algorithms

CSE 332: Data Structures & Parallelism Lecture 12: Comparison Sorting. Ruth Anderson Winter 2019

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

CS 241 Data Organization. August 21, 2018

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

Announcements. Course Staff. Course Staff. Lectures 10/19/11. CS/ENGRD 2110 Fall Instructor. Administrative Assistant

CSE 332: Data Structures & Parallelism Lecture 7: Dictionaries; Binary Search Trees. Ruth Anderson Winter 2019

CSE 373 APRIL 17 TH TREE BALANCE AND AVL

B+ Tree Review. CSE332: Data Abstractions Lecture 10: More B Trees; Hashing. Can do a little better with insert. Adoption for insert

CS 206 Introduction to Computer Science II

Computer Science 210: Data Structures

Lecture 2: Implementing ADTs

Syllabus CS 301: Data Structures Spring 2015

Computer Science 210 Data Structures Siena College Fall Topic Notes: Linear Structures

Introduction to Embedded Systems. Lab Logistics

Introduction to Computation and Problem Solving

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

CS 378 (Spring 2003) Linux Kernel Programming. Yongguang Zhang. Copyright 2003, Yongguang Zhang

Announcements. Course syllabus Tutorial/lab signup form (due 4pm today) Lecture 1 notes Homework 1 Initial assessment

Computer Science 210 Data Structures Siena College Fall Topic Notes: Linear Structures

Lecture 4 Stack and Queue

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

cs Java: lecture #6

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

CSE P 501 Compilers. Parsing & Context-Free Grammars Hal Perkins Spring UW CSE P 501 Spring 2018 C-1

Reasoning About Programs Panagiotis Manolios

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

CSE 373: Data Structures and Algorithms

CSE 341: Programming Languages

CPSC 213. Introduction to Computer Systems. Introduction. Unit 0

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

CSE 544 Principles of Database Management Systems

Welcome to CS 241 Systems Programming at Illinois

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid

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

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

Implementing Hash and AVL

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

Welcome to... CS113: Introduction to C

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing

CSC 443: Web Programming

ASYMPTOTIC COMPLEXITY

Welcome to CS 241 Systems Programming at Illinois

Programming Language Concepts, cs2104 Lecture 01 ( )

12 Abstract Data Types

Transcription:

CSE 332: Data Abstractions Ruth Anderson Spring 2014 Lecture 1

Welcome! We have 10 weeks to learn fundamental data structures and algorithms for organizing and processing information Classic data structures / algorithms and how to analyze rigorously their efficiency and when to use them Queues, dictionaries, graphs, sorting, etc. Parallelism and concurrency (!) 2

Today s Outline Introductions Administrative Info What is this course about? Review: Queues and stacks 3

CSE 332 Course Staff!! Instructor: Ruth Anderson Teaching Assistants: Hye In Kim 4

Me (Ruth Anderson) Grad Student at UW in Programming Languages, Compilers, Parallel Computing Taught Computer Science at the University of Virginia for 5 years Grad Student at UW: PhD in Educational Technology, Pen Computing Current Research: Computing and the Developing World, Computer Science Education Recently Taught: majors and non-majors data structures, architecture, compilers, programming languages, cse143, Designing Technology for Resource-Constrained Environments

Today s Outline Introductions Administrative Info What is this course about? Review: Queues and stacks 6

Course Information Instructor: Ruth Anderson, CSE 360 Office Hours: TBA, and by appointment, (rea@cs.washington.edu) Text: Data Structures & Algorithm Analysis in Java, (Mark Allen Weiss), 3rd edition, 2012 Course Web page: http://www.cs.washington.edu/332 7

Communication Course email list: cse332a_sp14@u Students and staff already subscribed You must get announcements sent there Fairly low traffic Course staff: cse332-staff@cs plus individual emails Discussion board For appropriate discussions; staff will monitor Optional, won t use for important announcements Anonymous feedback link For good and bad: if you don t tell me, I don t know 8

Course meetings Lecture (Ruth) Materials posted (sometimes afterwards), but take notes Ask questions, focus on key ideas (rarely coding details) Section (Hye In) Often focus on software (Java features, tools, project issues) Reinforce key issues from lecture Occasionally introduce new material Answer homework questions, etc. An important part of the course (not optional) Office hours Use them: please visit me Ideally not just for homework questions (but that s great too) 9

Course materials All lecture and section materials will be posted But they are visual aids, not always a complete description! If you have to miss, find out what you missed Textbook: Weiss 3 rd Edition in Java Good read, but only responsible for lecture/section/hw topics Will assign homework problems from it 3 rd edition improves on 2 nd, but we ll support the 2 nd Core Java book: A good Java reference (there may be others) Don t struggle Googling for features you don t understand Same/similar book recommended for CSE331 Parallelism / concurrency units in separate free resources designed for 332 10

Course Work 8 written/typed homeworks (25%) Due at beginning of class each Wednesday (not this week) No late homeworks accepted 3 programming projects (with phases) (25%) First phase of first project due next week Use Java and Eclipse (see this week s section) One 24-hour late-day for the quarter Projects 2 and 3 will allow partners Midterm - (20%) Final Exam - (25%) 11

Collaboration & Academic Integrity Read the course policy very carefully Explains quite clearly how you can and cannot get/provide help on homework and projects Gilligan s Island rule applies. Always proactively explain any unconventional action on your part When it happens, (not when asked) I offer great trust but with little sympathy for violations Honest work is the most important feature of a university 12

Unsolicited advice Get to class on time Start HW and projects as soon as they are posted! Make use of office hours/gopost/email Learn this stuff You need it for so many later classes/jobs anyway Falling behind only makes more work for you Have fun So much easier to be motivated and learn 13

Homework for Today!! 0) Review Java & install Eclipse 1) Project #1: (released tonight) bring questions to section on Thursday 2) Preliminary Survey: fill out by evening of Tues April 1 st 3) Information Sheet: bring to lecture on or before Friday April 4 th 4) Reading in Weiss (see handout) 14

Reading Reading in Data Structures and Algorithm Analysis in Java, 3 rd Ed., 2012 by Weiss For this week: (Topic for Project #1) Weiss 3.1-3.7 Lists, Stacks, & Queues (Wed) Weiss 1.1-1.6 Mathematics and Java (Fri) Weiss 2.1-2.4 Algorithm Analysis 15

Bring to Class on Friday: Name Email address Year (1,2,3,4,5) Hometown Interesting Fact or what I did over break. 16

Today s Outline Introductions Administrative Info What is this course about? Review: Queues and stacks 17

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 For parallelism: Use multiple processors to finish sooner For concurrency: Correct access to shared resources Will make many connections to the classic material 18

What 332 is about Deeply understand the basic structures used in all software Understand the data structures and their trade-offs Rigorously 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 19

Goals You will understand: what the tools are for storing and processing common data types which tools are appropriate for which need So that you will be able to: make good design choices as a developer, project manager, or system customer justify and communicate your design decisions 20

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 Problems where it actually matters how you do it 21

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 22

Views on this 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 stack problem, etc. 23

Data structures? Clever ways to organize information in order to enable efficient computation over that information. 24

Data structures! 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 25

Trade-offs A data structure strives to provide many useful, efficient operations But there are unavoidable trade-offs: Time vs. space One operation more efficient if another 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 26

Terminology Abstract Data Type (ADT) Mathematical description of a thing with set of operations on that thing Algorithm A high level, language-independent description of a step-by-step process Data structure A specific organization of data and family of algorithms for implementing an ADT Implementation of a data structure A specific implementation in a specific language 27

The Stack ADT Stack Operations: push pop top/peek is_empty A B C D E F F E D C B A 28

Example: Stacks The Stack ADT supports operations: push: adds an item pop: raises an error if isempty, else returns most-recently pushed item not yet returned by a pop isempty: initially true, later true if there have been same number of pops as pushes (Often some more operations) A Stack data structure could use a linked-list or an array or something else, and associated algorithms for the operations One implementation is in the library java.util.stack 29

Why useful The Stack ADT is a useful abstraction because: It arises all the time in programming (see text for more) Recursive function calls Balancing symbols (parentheses) Evaluating postfix notation: 3 4 + 5 * Clever: Infix ((3+4) * 5) to postfix conversion (see text) 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 30

Today s Outline Introductions Administrative Info What is this course about? Review: Queues and stacks 31

The Queue ADT Queue Operations: enqueue dequeue G enqueue F E D C B dequeue A is_empty 32

Circular Array Queue Data Structure Q: 0 size - 1 b c d e f front back // Basic idea only! enqueue(x) { Q[back] = x; back = (back + 1) % size } // Basic idea only! 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? 33

Linked List Queue Data Structure b c d e f front // Basic idea only! enqueue(x) { back.next = new Node(x); back = back.next; } // Basic idea only! 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? 34

Circular Array vs. Linked List 35

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 k th 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 k th element For operation insertatposition must traverse all earlier elements Not in Queue ADT 36

Homework for Today!! 0) Review Java & install Eclipse 1) Project #1: (released tonight) bring questions to section on Thursday 2) Preliminary Survey: fill out by evening of Tues April 1 st 3) Information Sheet: bring to lecture on or before Friday April 4 th 4) Reading in Weiss (see handout) 37