CSE 326: Data Structures Lecture #0 Introduction Bart Niswonger Summer Quarter 2001.

Slides:



Advertisements
Similar presentations
Queues A waiting line that grows by adding elements to its end and shrinks by taking elements from its front Line at the grocery store Cars in traffic.
Advertisements

0 of 37 Stacks and Queues Lecture of 37 Abstract Data Types To use a method, need to know its essentials: signature and return type o additionally,
Come up and say hello! 1. CPSC 221: Algorithms and Data Structures Lecture #0: Introduction Steve Wolfman 2011W2 2.
Come up and say hello! 1. CPSC 221: Algorithms and Data Structures Lecture #0: Introduction Steve Wolfman 2009W1 2.
CSE332: Data Abstractions Lecture 1: Introduction; Stacks/Queues Dan Grossman Spring 2010.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
CSE 326: Data Structures Introduction 1Data Structures - Introduction.
Come on down! Take and fill out a survey Get a copy of lecture slides Please sit in the first 5 rows!
Administrivia- Introduction CSE 373 Data Structures.
Stack: Linked List Implementation Push and pop at the head of the list New nodes should be inserted at the front of the list, so that they become the top.
EE 220 (Data Structures and Analysis of Algorithms) Instructor: Saswati Sarkar T.A. Prasanna Chaporkar, Programming.
CSE 326: Data Structures Lecture #0 Introduction Steve Wolfman Winter Quarter 2000.
Come on down! Take and fill out a survey Get a copy of lecture slides Please sit in the first 5 rows!
Chapter 1 Introduction Definition of Algorithm An algorithm is a finite sequence of precise instructions for performing a computation or for solving.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Dan Grossman Fall 2013.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Lauren Milne Summer 2015.
CSCE 3110 Data Structures and Algorithm Analysis.
Computer Science 102 Data Structures and Algorithms V Fall 2009 Lecture 1: administrative details Professor: Evan Korth New York University 1.
CSE 373 Data Structures and Algorithms Lecture 2: Queues.
WEEK 1 CS 361: ADVANCED DATA STRUCTURES AND ALGORITHMS Dong Si Dept. of Computer Science 1.
© 2004 Goodrich, Tamassia CS2210 Data Structures and Algorithms Lecture 1: Course Overview Instructor: Olga Veksler.
Data Structures and Programming.  Today:  Administrivia  Introduction to 225, Stacks  Course website: 
Data Structures Lecture 1: Introduction Azhar Maqsood NUST Institute of Information Technology (NIIT)
Come up and say hello! (Welcome!) 1. CPSC 221: Algorithms and Data Structures Lecture #0: Introduction Kendra Cooper 2014W1 2.
CSE332: Data Abstractions Lecture 1: Introduction; Stacks/Queues Tyler Robison Summer 2010.
1 CS 233 Data Structures and Algorithms 황승원 Fall 2010 CSE, POSTECH.
CSCA48 Course Summary.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Nicki Dell Spring 2014.
COMPE 226 Data Structures 2015 Fall Murat KARAKAYA Department of Computer Engineering.
BIM213 – Data Structures and Algorithms Introduction 1.
CSE332: Data Abstractions Lecture 1: Introduction; ADTs; Stacks/Queues Dan Grossman Spring 2012.
COMP2012 Object-Oriented Programming and Data Structures Fall 2015.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Introduction.
30 May Stacks (5.1) CSE 2011 Winter Stacks2 Abstract Data Types (ADTs) An abstract data type (ADT) is an abstraction of a data structure An.
Come up and say hello! 1. CPSC 221: Algorithms and Data Structures Lecture #0: Introduction Steve Wolfman 2010W2 2.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Kevin Quinn Fall 2015.
Introduction to ECE 2401 Data Structure Fall 2005 Chapter 0 Chen, Chang-Sheng
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Catie Baker Spring 2015.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Introduction.
Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy Walters, and Godfrey Muganda Chapter 18: Stacks and Queues.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Linda Shapiro Winter 2015.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
CSE 373: Data Structures and Algorithms Lecture 2: Queues.
Course Info Instructor U.T. Nguyen Office: CSEB Office hours: Tuesday, 14:30-15:30 Thursday, 12:00-12:45 By.
Data Structures and Algorithms in Java AlaaEddin 2012.
CSE 326 More Lists, Stacks and Queues David Kaplan Dept of Computer Science & Engineering Autumn 2001.
3/3/20161 Stacks and Queues Introduction to Data Structures Ananda Gunawardena.
Principles of Imperative Computation Lecture 1 January 15 th, 2012.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Aaron Bauer Winter 2014.
1 CENG 707 Data Structures and Algorithms Nihan Kesim Çiçekli Department of Computer Engineering Middle East Technical University Fall 2013.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Linda Shapiro Spring 2016.
CSE373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks/Queues Hunter Zahn Summer 2016 CSE373: Data Structures and Algorithms1.
CENG 707 Data Structures and Algorithms
March 27 – Course introductions; Adts; Stacks and Queues
CS 315 Data Structures B. Ravikumar Office: 116 I Darwin Hall Phone:
CSE 373: Data Structures and Algorithms
Cse 373 April 26th – Exam Review.
Lecture 1: Welcome to CSE 373
structures and their relationships." - Linus Torvalds
structures and their relationships." - Linus Torvalds
Introduction CSE 373 Data Structures.
Ben Lerner Summer Quarter 2007 Lecture 1
Spring 2016 Richard Anderson Lecture 1
Stacks and Queues 1.
Administrivia- Introduction
Principles of Imperative Computation
Administrivia- Introduction
structures and their relationships." - Linus Torvalds
Presentation transcript:

CSE 326: Data Structures Lecture #0 Introduction Bart Niswonger Summer Quarter 2001

Come up and say hello!

Today’s Outline Administrative Cruft Overview of the Course Queues Stacks Project #1

Course Information Instructor: Bart Niswonger 226D Sieg Hall Office hours: M 11:50-12:50, W 1:50-2:50 & whenever door is open TA: Ashish Office hours: Tues 10:50-11:50 in 226A/B Text: Data Structures & Algorithm Analysis in C++, 2 nd edition, by Mark Allen Weiss

Tutorials Unix I –Tuesday, June 19 th –10:50-11:50 + lab time, Sieg 322 Templates –Thursday, June 21 st –10:50-11:50 + lab time, GUG 410 In place of section Unix Development –Tuesday, June 26 th –10:50-11:50 + lab time, Sieg 322 REQUIRED

Roughly weekly written homework due at the start of class on the due date Projects (4 total) due by 10PM on the due date –you have 4 late days for projects Grading –homework:15% –projects:25% –midterm:20% –final:30% –best of these:10% Course Policies PARTICIPATION!

Course Mechanics 326 Web page: www/education/courses/326/01su 326 course directory: /cse/courses/cse mailing list: –subscribe to the mailing list using majordomo, see homepage Course labs are 232 and 329 Sieg Hall –lab has NT machines w/X servers to access UNIX All programming projects graded on UNIX/g++

Goals of the Course Become familiar with some of the fundamental data structures in computer science Improve ability to solve problems abstractly –data structures are the building blocks Improve ability to analyze your algorithms –prove correctness –gauge (and improve) time complexity Become modestly skilled with the UNIX operating system and X-windows (you’ll need this in upcoming courses)

Observation All programs manipulate data –programs process, store, display, gather –data can be information, numbers, images, sound Each program must decide how to store data Choice influences program at every level –execution speed –memory requirements –maintenance (debugging, extending, etc.)

What is a Data Structure? data structure -

What is an Abstract Data Type? Abstract Data Type (ADT) - 1) An opportunity for an acronym 2) Mathematical description of an object and the set of operations on the object

Data Structures : Algorithms Algorithm –A high level, language independent description of a step-by-step process for solving a problem Data Structure –A set of algorithms which implement an ADT

Why so many data structures? Ideal data structure: fast, elegant, memory efficient Generates tensions: –time vs. space –performance vs. elegance –generality vs. simplicity –one operation’s performance vs. another’s Dictionary ADT –list –binary search tree –AVL tree –Splay tree –Red-Black tree –hash table

Code Implementation Theoretically –abstract base class describes ADT –inherited implementations implement data structures –can change data structures transparently (to client code) Practice –different implementations sometimes suggest different interfaces (generality vs. simplicity) –performance of a data structure may influence form of client code (time vs. space, one operation vs. another)

ADT Presentation Algorithm Present an ADT Motivate with some applications Repeat until browned entirely through –develop a data structure for the ADT –analyze its properties efficiency correctness limitations ease of programming Contrast data structure’s strengths and weaknesses –understand when to use each one

Queue ADT Queue operations –create –destroy –enqueue –dequeue –is_empty Queue property: if x is enQed before y is enQed, then x will be deQed before y is deQed FIFO: First In First Out F E D C B enqueue dequeue G A

Applications of the Q Hold jobs for a printer Store packets on network routers Hold memory “freelists” Make waitlists fair Breadth first search

Circular Array Q Data Structure void enqueue(Object x) { Q[back] = x back = (back + 1) % size } Object dequeue() { x = Q[front] front = (front + 1) % size return x } bcdef Q 0 size - 1 frontback This is pseudocode. Do not correct my semicolons. When is the Q empty? Are there error situations this code will not catch? What are some limitations of this structure?

Q Example enqueue R enqueue O dequeue enqueue T enqueue A enqueue T dequeue enqueue E dequeue

Linked List Q Data Structure bcdef frontback void enqueue(Object x) { if (is_empty()) front = back = new Node(x) else back->next = new Node(x) back = back->next } Object dequeue() { assert(!is_empty) return_data = front->data temp = front front = front->next delete temp return temp->data }

Circular Array vs. Linked List

LIFO Stack ADT Stack operations –create –destroy –push –pop –top –is_empty Stack property: if x is on the stack before y is pushed, then x will be popped after y is popped LIFO: Last In First Out A BCDEFBCDEF E D C B A F

Stacks in Practice Function call stack Removing recursion Balancing symbols (parentheses) Evaluating Reverse Polish Notation Depth first search

Array Stack Data Structure S 0 size - 1 fedcb void push(Object x) { assert(!is_full()) S[back] = x back++ } Object top() { assert(!is_empty()) return S[back - 1] } back Object pop() { back-- return S[back] } bool is_full() { return back == size }

Linked List Stack Data Structure bcdef back void push(Object x) { temp = back back = new Node(x) back->next = temp } Object top() { assert(!is_empty()) return back->data } Object pop() { assert(!is_empty()) return_data = back->data temp = back back = back->next return return_data }

Data structures you should already know Arrays Linked lists Trees Queues Stacks

To Do Sign up on the cse326 mailing list Check out the web page Log on to a PC in the course labs and access an instructional UNIX server Read Chapters 1 and 3 in the book

Coming Up Unix Tutorial –Tuesday (tomorrow) 10:50, Sieg 322 Multi-Lists Priority Queues and Heaps Templates Tutorial First homework