Welcome and Introduction 15-211 Fundamental Data Structures and Algorithms Margaret Reid-Miller and Aleks Nanevski January 13, 2004.

Slides:



Advertisements
Similar presentations
CSc 2310 Principles of Programming (Java)
Advertisements

Today: 1. Hand back/review Test 1 2. Lecture on Section 3.1, with HW 3.1 due tomorrow 3. Daily Quiz at end of hour, on Test 1 questions.
COMP 110 Introduction to Programming Tabitha Peck M.S. January 9, 2008 MWF 3-3:50 pm Philips 367.
June 13, Introduction to CS II Data Structures Hongwei Xi Comp. Sci. Dept. Boston University.
CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Computer Science - I Course Introduction Computer Science Department Boston College Hao Jiang.
Need your MyMathLab card with your access code Need a Valid Address Need to know Purdue’s zip code is and your course ID for your Class You.
SEAS Acad Mtg – 8/26/03Prof. Frank Sciulli Introduction - Physics SEAS Academic Meeting l Intro: Frank Sciulli – Professor in the Physics Dept. u Lecturing.
OBJECT ORIENTED PROGRAMMING I LECTURE 1 GEORGE KOUTSOGIANNAKIS
COMP171 Data Structures and Algorithm Qiang Yang Lecture 1 ( Fall 2006)
Need your MyMathLab card with your access code Need a Valid Address Need to know Purdue’s zip code is and your course ID for your Class You.
EE 220 (Data Structures and Analysis of Algorithms) Instructor: Saswati Sarkar T.A. Prasanna Chaporkar, Programming.
COMP 110 Introduction to Programming Mr. Joshua Stough August 22, 2007 Monday/Wednesday/Friday 3:00-4:15 Gardner Hall 307.
COMP 14 – 02: Introduction to Programming Andrew Leaver-Fay August 31, 2005 Monday/Wednesday 3-4:15 pm Peabody 217 Friday 3-3:50pm Peabody 217.
July 16, Introduction to CS II Data Structures Hongwei Xi Comp. Sci. Dept. Boston University.
Please open your laptops, log in to the MyMathLab course web site, and open Quiz 3.1 IMPORTANT NOTE: If you have time left on your quiz clock after you.
Section 1.3 Prime numbers and fractions
Minimum Spanning Tree in Graph - Week Problem: Laying Telephone Wire Central office.
Please open your laptops, log in to the MyMathLab course web site, and open Quiz 3.6B. IMPORTANT NOTE: If you have time left after you finish the problems.
Computer Science 102 Data Structures and Algorithms V Fall 2009 Lecture 1: administrative details Professor: Evan Korth New York University 1.
COMP 151: Computer Programming II Spring Course Topics Review of Java and basics of software engineering (3 classes. Chapters 1 and 2) Recursion.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note-taking materials. Today’s daily quiz will be given at the.
WEEK 1 CS 361: ADVANCED DATA STRUCTURES AND ALGORITHMS Dong Si Dept. of Computer Science 1.
Log into your account Go to Locate MAT 2401 and the First Day PPT.
© 2004 Goodrich, Tamassia CS2210 Data Structures and Algorithms Lecture 1: Course Overview Instructor: Olga Veksler.
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
Please open Daily Quiz 34. A scientific calculator may be used on this quiz. You can keep your yellow formula sheets out when you take the quiz. Remember.
BIT 115: Introduction To Programming1 Sit in front of a computer Log in –Username: 230class –password: –domain: student Bring up the course web.
CSE 501N Fall ‘09 00: Introduction 27 August 2009 Nick Leidenfrost.
COMP Introduction to Programming Yi Hong May 13, 2015.
CSc 2310 Principles of Programming (Java) Dr. Xiaolin Hu.
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
Welcome to CS 115! Introduction to Programming. Class URL
Catie Welsh January 10, 2011 MWF 1-1:50 pm Sitterson 014.
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
Welcome to CS 115! Introduction to Programming. Class URL Write this down!
1 Principles of Computer Science I Note Set 1 CSE 1341.
Computer Science 102 Data Structures and Algorithms CSCI-UA.0102 Fall 2012 Lecture 1: administrative details Professor: Evan Korth New York University.
PHY 1405 Conceptual Physics (CP 1) Spring 2010 Cypress Campus.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Introduction.
Math 115b Section 3 (Spring 09)  Instructor: Kerima Ratnayaka   Phone :  Office.
MAT 1235 Calculus II Winter 2015
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Matter and Interactions 1 Fall 2006 Matter & Interactions I Physics Professor & Lecturer: Dr. Reinhard Schumacher Teaching Assistants: Ms. Elisa.
Evaluation & Assessment 10/31/06 10/31/06. Typical Point Breakdown COURSE GRADES: Grades will be assigned on the basis of 450 points, distributed as follows:
Welcome to COMP 250 Introduction to Computer Science! Mathieu Blanchette.
ICS202 Data Structures King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science Department.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Introduction.
Fundamental Data Structures and Algorithms Peter Lee April 24, 2003 Union-Find.
CSCE 1030 Computer Science 1 First Day. Course Dr. Ryan Garlick Office: Research Park F201 B –Inside the Computer Science department.
Physics 1B3-summer Lecture 11 Welcome to Physics 1B03 !
Course Review Fundamental Structures of Computer Science Margaret Reid-Miller 29 April 2004.
CSE373: Data Structures & Algorithms Lecture 9: Disjoint Sets and the Union-Find ADT Lauren Milne Summer 2015.
CS151 Introduction to Digital Design Noura Alhakbani Prince Sultan University, College for Women.
BIT 143: Programming – Data Structures It is assumed that you will also be present for the slideshow for the first day of class. Between that slideshow.
1 CS 381 Introduction to Discrete Structures Lecture #1 Syllabus Week 1.
Data Structures and Algorithms in Java AlaaEddin 2012.
BIT 143: Programming-Data Structures1 Before Class Begins: Sit in front of a computer Log in –IF you don’t yet have an account, you can use the guest account.
CSE 1340 Introduction to Computing Concepts Class 1 ~ Intro.
Principles of Imperative Computation Lecture 1 January 15 th, 2012.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
Spring 2008 Mark Fontenot CSE 1341 – Honors Principles of Computer Science I Note Set 1 1.
Syllabus and Class Policies MATH 130: Summer 2016.
CS140 – Computer Programming 1 Course Overview First Semester – Fall /1438 – 2016/2017 CS140 - Computer Programming 11.
電腦圖學 Computer Graphic with Programming
Computer Science 102 Data Structures CSCI-UA
MA Fall 2016 Instructor: Matt Weaver Office: MATH 615
Tonga Institute of Higher Education IT 141: Information Systems
Principles of Imperative Computation
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

Welcome and Introduction Fundamental Data Structures and Algorithms Margaret Reid-Miller and Aleks Nanevski January 13, 2004

What is this course about?

 How to solve computing problems.  Problem analysis, to abstract away details and divide into smaller subproblems.  Mathematical foundations for precise formulations of problems and solutions.  Data structures and algorithms to solve problems correctly and efficiently.  Java programming and modular software construction for good implementations.

An Example

Generating mazes  We want to write a program to generate mazes.  We want every maze to be solvable.

Generating mazes, cont’d  Also: We want mazes to be fun, i.e.,  We want maze solutions to be unique.  We want every “room” to be reachable. How should we think about this?

Let’s hack!

2am in the WeH cluster…

No, let’s think!

Thinking about the problem  Think about a grid of rooms separated by walls.  Each room can be given a name. abcd hgfe ijkl ponm Randomly knock out walls until we get a good maze.

Mathematical formulation  A set of rooms:  {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p}  Pairs of adjacent rooms that have an open wall between them.  For example, (a,b) and (g,k) are pairs. abcd hgfe ijkl ponm

Graphs  Abstractly, this is a mathematical structure called a graph.  Informally, a graph consists of a set of nodes and a set of edges.

Mazes as graphs  A maze is a graph where  each node represents a room, and  an edge from node x to node y indicates that rooms x and y are adjacent and there is no wall in between them.  A part of this course will be about graph algorithms.

Why math?  Q: Why is it useful to formulate the problem so that mazes are graphs?  A: Data structures are typically defined as mathematical structures.  A: Mathematics can be used to reason about the correctness and efficiency of data structures and algorithms.  A: Mathematical structures make it easier to think — to abstract away from unnecessary details and avoid “hacking”.

Mazes as graphs abcd hgfe ijkl ponm {(a,b), (b,c), (a,e), (e,i), (i,j), (f,j), (f,g), (g,h), (d,h), (g,k), (m,n), (n,o), (k,o), (o,p), (l,p)}

Mazes as graphs {(a,b), (b,c), (a,e), (e,i), (i,j), (f,j), (f,g), (g,h), (d,h), (g,k), (m,n), (n,o), (k,o), (o,p), (l,p)} abcd efgh ijkl mnop

Unique solutions  What property must the graph have for the maze to have a solution?  A path from (a) to (p).  What property must it have for the maze to have a unique solution?  Graph must be a tree. abcd efgh ijkl mnop

Mazes as trees  Informally, a tree is a graph:  with a unique root node, and  each node having a unique parent.  A spanning tree is a tree that includes all of the nodes.  Why is it good to have a spanning tree? a b c d e f g h i j k lm n o p Trees have no cycles!

What is this course about? 1. Thinking about problems abstractly.

Algorithm  Now that we have a data structure in mind, we can think about the algorithm.  Essentially:  Randomly pick a wall and delete it (add it to the tree) if it won’t create a cycle.  Stop when a spanning tree has been created.  This is Kruskal’s Algorithm.

Creating a spanning tree  When adding a wall to the tree, how do we detect that it won’t create a cycle?  When adding wall (x,y), we want to know if there is already a path from x to y in the tree.  In fact, there is a fast algorithm for doing exactly this, called union-find.

Using the union-find algorithm  We put rooms into an equivalence class if there is a path connecting them.  Before adding an edge (x,y) to the tree, make sure that x and y are not in the same equivalence class. abcd efgh ijkl mnop Partially- constructed maze

How fast?  Is this a fast way to generate mazes?  How much time will it take to generate a maze?  What do we mean by “fast”?  In addition to finding the right algorithms, analyzing the performance of algorithms will be a major part of this course.

Performance and Scaling  Suppose we have three algorithms to choose from.  Which one to select?  Systematic analysis reveals performance characteristics.  For a problem of size n (i.e., detecting cycles out of n nodes) n sec 2.7n 2 sec 3.2 n sec

Performance and Scaling n 100n sec7n 2 sec2 n sec s7 s2 s 5.5 ms 175 s32 s 101 ms.7 ms1 ms ms14 ms1 year 100……… 1,000 10,000 1,000,000

Performance and Scaling n 100n sec7n 2 sec2 n sec s7 s2 s 5.5 ms 175 s32 s 101 ms.7 ms1 ms ms14 ms1 year 100……… 1,000 10,000 1,000,000

What?! One year?  2 10 = 1,024  1024 sec  1 ms  2 45 = 35,184,372,088,832  3.5 * sec =3.5 * 10 7 sec  1.1 year

Performance and Scaling n 100n sec7n 2 sec2 n sec s7 s2 s 5.5 ms 175 s32 s 101 ms.7 ms1 ms ms14 ms1 year ms7 sec10 16 year 1,0001 sec12 min-- 10,00010 sec20 hr-- 1,000, min.22 year--

What is this course about? 2. Selecting good data structures and fast algorithms.

Modular design  By thinking about the problem, we have strong hints about the structure of our program  Grids, Graphs (with edges and nodes), Spanning trees, Union-find.  With disciplined programming, we can write our program to reflect this structure.  Modular programs are usually easier to get right and easier to understand.

Modular design SpanningTree Maze GraphGrid MazeDraw UnionFind Reusable components

Is it correct?  How will we know if we implemented our solution correctly?  What do we mean by “correct”?  Will it generate the right answers?  Will it terminate?  We will spend some time in this course on techniques for proving the correctness of programs.

What is this course about? 3. Implementing programs that are understandable and correct.

Instant Quiz

Instant quiz: Two questions  Given that we are using trees to represent mazes, what would be a simple algorithm for solving mazes?  Besides insisting on spanning trees, what other criteria might one want in order to improve the “quality” or “fun factor” of the mazes? a b c d e f g h i j k lm n o p

What is this course about?

The science in CS  Not “hacking”, but:  Thinking about problems abstractly.  Selecting good data structures and obtaining correct and fast algorithms.  Implementing programs that are understandable and correct.

How the Course Works

Course staff  A complete listing of the course staff (including instructors and teaching assistants) will be available on the course Blackboard site. 

Prerequisites  Basic programming skills.  Provided by or  Basic discrete math and logic.  Provided by  This course is not about Java programming, but about how to solve problems on a computer.

How will be different?  Faster pace.  Lots of reading, thinking, programming.  Assumption of mature work habits.  Starting early, overcoming obstacles.  Larger homework assignments.  Typically requiring several days of work.  More open-ended problems to solve.  Sometimes no single “right” answer.

Textbook  Mark Allen Weiss, Data Structures & Algorithm Analysis in Java.  edu/~weiss  Addison-Wesley, 2002.

Recitations  Starts tomorrow!  Questions are answered, new material is covered, and homeworks might be graded.  Some TAs will insist that you go to recitation in order to get a grade on your homeworks!  Switching sections is possible.  But the sections must be balanced.  Talk to the TAs – they are in charge.

Recitations and your TA  Recitation sessions are also the place for you to get to know your TA…  …and for your TA to get to know you  Your TA will be responsible for assigning almost all of your grades for this course!

Go to Recitation!!!

Handouts and information  Everything on Blackboard (Bb) system.   User id: your Andrew id.  Password: your Andrew password.

The Blackboard (Bb) system  Check Bb frequently for  Announcements.  Course policies.  You must read the cheating policy.  Contact information.  Course schedule and calendar.  Discussion bboard.

Requirements  Participation in lectures and recitations.  Reading assignments.  Homework assignments.  Online quizzes.  In-class and final exams.

Grades  1 “warmup”.  3 small homeworks.  3 large homeworks.  3 quizzes.  Midterm exam.  Final exam.  TA discretion.  39 points.  50 points each.  100 points each.  20 points each.  125 points.  275 points.  50 points. SUBJECT TO CHANGE

Homework assignments  Goal: Reinforce and apply what is taught in class.  Early homeworks will be small individual programming assignments.  Later homeworks will be much larger assignments, working in groups of two.

What kind of Assignments?  How do we write our own little search engine?  How do we compress a file?  lossless (winzip)  lossy (jpeg)  How do we design and program a game?  How to analyze the game board?  How to pick the best move?

Homework administration  Electronic handout (on Bb), handin, & handback.  All due on Mondays 11:59pm.  Cluster hours on some evenings, to be announced.  Up to 24 hours late for -50%.  No handins accepted after 24 hours.

If you need an extension  DO NOT SEND !  All s on this topic will be ignored.  You must see an instructor face-to- face and explain the reasons.  We will be reasonable.

If you need an extension DO NOT SEND !

Homework assignment 0  HW0 is available now!  Download and get started today.  HW0 due on Monday at 11:59pm!  Handin of a working assignment will get the full 40 points credit.  Gets you started with the software tools used in this course.

Software tools  We recommend the use of standard tools.  Sun’s Java development kit (J2SE 1.4.1).  Emacs text editor.  Unix (Linux, Solaris, MacOS X, Cygwin).  Web-based handin system.

Cheating  There is no need to cheat in this course.  If you are in trouble, come and talk to us.  We are here to help you.  We expect you to know what is useful collaboration and what is cheating.  We will be using advanced data-mining tools to monitor the originality of all programs that are handed in

Original code  For programming assignments, you will be required to hand in your own original code  You may discuss your homeworks with others, but if doing so impairs your ability to write truly original code, then you are cheating  More on this as the semester goes on…

Consequences of cheating  If you cheat, you should come to us immediately for help.  We will try to be lenient.  If we catch you, you will either  lose at least double credit, or  fail the course.  Especially bad cases will be officially reported to the Associate Dean.

Homework discipline  Start early.  Most assignments will require more than 1 evening to complete.  Larger assignments will require several days of group work.  Remember:  Don’t start by sitting at a blank screen.  Humans will be trying to understand your code when grading it.

Summary  Go to recitation  Check out the Blackboard site  And welcome to the course!