Course Overview CS221 – Advanced Programming Fall 2007 : Ray S. Babcock Computer Science Department Montana State University.

Slides:



Advertisements
Similar presentations
Chapter 1: INTRODUCTION TO DATA STRUCTURE
Advertisements

Recursion Genome 559: Introduction to Statistical and Computational Genomics Elhanan Borenstein.
Computer Science 112 Fundamentals of Programming II Overview of Collections.
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
Sorting CS221 – 3/2/09. Recursion Recap Use recursion to improve code clarity Make sure the performance trade-off is worth it Every recursive method must.
© 2006 Pearson Addison-Wesley. All rights reserved10-1 Chapter 10 Algorithm Efficiency and Sorting CS102 Sections 51 and 52 Marc Smith and Jim Ten Eyck.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Data Structures & Algorithms What The Course Is About s Data structures is concerned with the representation and manipulation of data. s All programs.
CS 206 Introduction to Computer Science II 10 / 14 / 2009 Instructor: Michael Eckmann.
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
Data Structures Introduction. What is data? (Latin) Plural of datum = something given.
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 10.
CS 206 Introduction to Computer Science II 12 / 10 / 2008 Instructor: Michael Eckmann.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
DATA STRUCTURE Subject Code -14B11CI211.
Data Structures 1- Course Syllabus. 2- Introduction about Data Structures.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
SIGCSE Tradeoffs, intuition analysis, understanding big-Oh aka O-notation Owen Astrachan
CS1101: Programming Methodology Aaron Tan.
Week 2 CS 361: Advanced Data Structures and Algorithms
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Lecture 10: Class Review Dr John Levine Algorithms and Complexity March 13th 2006.
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
Homework #5 New York University Computer Science Department Data Structures Fall 2008 Eugene Weinstein.
1 Week 9 A little more GUI, and threads. Objectives: Discuss the Swing set of classes. Incorporate animation into applets. Define the term thread. Explain.
Review and Prepare for Test 3 CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science.
Data Structure Introduction.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Java Methods Big-O Analysis of Algorithms Object-Oriented Programming
1 BIM304: Algorithm Design Time: Friday 9-12am Location: B4 Instructor: Cuneyt Akinlar Grading –2 Midterms – 20% and 30% respectively –Final – 30% –Projects.
Computer Science Projects Internal Assessment. Mastery Item Claimed Justification Where Listed Random Access File – Searching Lines P. 53 Random.
Elementary Data Organization. Outline  Data, Entity and Information  Primitive data types  Non primitive data Types  Data structure  Definition 
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
Final Exam Tuesday, December 22nd 2:00 - 3:50pm room 102 Warren Weaver Hall.
Efficiency of Algorithms. Node - data : Object - link : Node + createNode() + getData() + setData() + getLink() + setLink() + addNodeAfter() + removeNodeAfter()
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 23 Algorithm Efficiency.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Array Lists Array Lists Dale.
CS321 Data Structures Jan Lecture 2 Introduction.
 Saturday, April 20, 8:30-11:00am in B9201  Similar in style to written midterm exam  May include (a little) coding on paper  About 1.5 times as long.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Data Structure and Algorithms
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 External Sorting Chapter 13.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Common Elementary Algorithms Some of the basic but frequently used algorithms for manipulating arrays. These algorithms are so important that: a)Some programming.
AP National Conference, AP CS A and AB: New/Experienced A Tall Order? Mark Stehlik
Lecture 2. Algorithms and Algorithm Convention 1.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Final Exam Review CS 3358.
Analysis and Comparison is ICS4U
Midterm Review.
External Sorting Chapter 13
Teach A level Computing: Algorithms and Data Structures
CS302 Data Structures Fall 2012.
Building Java Programs
External Sorting Chapter 13
Data Structures: Introductory lecture
COP 3502.
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
Introduction to Computer Science for Majors II
IT 4043 Data Structures and Algorithms
Building Java Programs
Algorithm Efficiency and Sorting
Overview Analysis Notation Specific ADTs
Review B.Ramamurthy 4/6/2019 BR.
Course Overview CS221 – Advanced Programming
CS Fall 2012, Lab 11 Haohan Zhu.
Final Review B.Ramamurthy 5/8/2019 BR.
External Sorting Chapter 13
Presentation transcript:

Course Overview CS221 – Advanced Programming Fall 2007 : Ray S. Babcock Computer Science Department Montana State University

CS221 F'07 2Course Overview Finally! Not an introductory course! Finally! Not an introductory course! An old 1976 book had the following title: An old 1976 book had the following title: Algorithms + Data Structures = Programs Algorithms + Data Structures = Programs By Nicklaus Wirth By Nicklaus Wirth Both Algorithms AND Data Structures should be considered equally important when solving problems using programs. Both Algorithms AND Data Structures should be considered equally important when solving problems using programs. Time – Space tradeoff. Time – Space tradeoff. Time and space are inversely proportional. Time and space are inversely proportional.

CS221 F'07 3Course Overview Time VS Space To produce the same solution in less space (memory) an increase of computation time is necessary. To produce the same solution in less space (memory) an increase of computation time is necessary. The Invoice File Sorting Problem from The Invoice File Sorting Problem from Many invoices for each month during the year. Many invoices for each month during the year. Random Access Memory was extremely limited. 64K Random Access Memory was extremely limited. 64K Yes, only 64K, and the OS took up 32K!! Yes, only 64K, and the OS took up 32K!! Can’t load all the invoices into RAM. Can’t load all the invoices into RAM. Can load all the invoices on the huge 128K 8-inch Floppies. Can load all the invoices on the huge 128K 8-inch Floppies. No disk sort commands (like the Linux sort command). No disk sort commands (like the Linux sort command). How would you solve this problem? How would you solve this problem?

CS221 F'07 4Course Overview The Invoice File Solution The disk (floppy) file management system had up to 16 file units. The disk (floppy) file management system had up to 16 file units. A separate file can be “opened” on each file unit. A separate file can be “opened” on each file unit. We opened a separate file for each month: We opened a separate file for each month: Opened “Jan” on file unit 1. Opened “Jan” on file unit 1. Opened “Feb” on file unit 2. Opened “Feb” on file unit 2. … Opened “Dec” on file unit 12. Opened “Dec” on file unit 12. Opened “Input” on file unit 13. Opened “Input” on file unit 13.

CS221 F'07 5Course Overview Invoice File Solution (continued) Now for each Invoice in the input file (opened on 13) Now for each Invoice in the input file (opened on 13) Read one invoice into memory. Read one invoice into memory. Extract the month code (1 – 12) as an integer. Extract the month code (1 – 12) as an integer. Write the invoice to the “month” file unit. Write the invoice to the “month” file unit. Repeat. Repeat. Close all 13 file units. Close all 13 file units. One pass through the input file and it was done! One pass through the input file and it was done! Only memory for one invoice needed! Only memory for one invoice needed! Cool! Cool!

CS221 F'07 6Course Overview Algorithms In this course we will cover extensively In this course we will cover extensively Traversals and Searches Traversals and Searches Linear Linear Binary Binary Sorting Sorting Selection Selection Bubble Bubble Insertion Insertion (and more lightly: Shell, Merge, Heap, and Quicksort) (and more lightly: Shell, Merge, Heap, and Quicksort)

CS221 F'07 7Course Overview Data Structures In this course we will cover extensively In this course we will cover extensively Lists Lists Stacks Stacks Queues Queues We will touch lightly on We will touch lightly on Trees Trees Priority Queues Priority Queues Graphs Graphs

CS221 F'07 8Course Overview Course Title? Advanced Programming (new) versus Data Structures (old) ? Advanced Programming (new) versus Data Structures (old) ? Event-Oriented Programming. Event-Oriented Programming. Java AWT and SWING for GUI building. Java AWT and SWING for GUI building. UML (appendix B and used throughout). UML (appendix B and used throughout). Software Design. Software Design. Program Correctness and Efficiency (Big O notation). Program Correctness and Efficiency (Big O notation). Java Inheritance. Java Inheritance. Java Class Hierarchies. Java Class Hierarchies. And last but certainly not least Abstract Data Types. And last but certainly not least Abstract Data Types.

CS221 F'07 9Course Overview What is a type? What does it mean by specifying: What does it mean by specifying: int int double double boolean boolean String String Is 2+2 calculated the same as ? Is 2+2 calculated the same as ? What does memory look like? What does memory look like?

CS221 F'07 10Course Overview Segment from a CS425 program that displays a bézier curve! (obviously )

CS221 F'07 11Course Overview A Type Simply limits The values The values The operations The operations Helps prevent the following: Helps prevent the following: Assume I let and integer MONTH stand for the current month. (1 = Jan, 2 = Feb, … 12 = Dec). Assume I let and integer MONTH stand for the current month. (1 = Jan, 2 = Feb, … 12 = Dec). Now I work my way through the year by using MONTH = MONTH + 1 Now I work my way through the year by using MONTH = MONTH + 1 What happens when I use that expression when MONTH equals 12? What is month 13? What happens when I use that expression when MONTH equals 12? What is month 13? The March 0 story. The March 0 story.

CS221 F'07 12Course Overview Some In Class Examples. Given: (ignore the – bullets!) Given: (ignore the – bullets!) int a = 2; int a = 2; int b = 4; int b = 4; int c = 5; int c = 5; double d = 1.2; double d = 1.2; double e = 2.4; double e = 2.4; double f = 3.6; double f = 3.6; double g = 1.55; double g = 1.55; double sum = 0.0; double sum = 0.0; What prints System.out.println(expression); What prints System.out.println(expression);

CS221 F'07 13Course Overview Integers a=2,b=4,c=5 Doubles d=1.2,e=2.4,f=3.6,g=1.55,sum=0.0 (a/b) (a/b) 0 (b/a) (b/a) 2 (1/a) (1/a) 0 c/a c/a 2 a/d a/d

CS221 F'07 14Course Overview Integers a=2,b=4,c=5 Doubles d=1.2,e=2.4,f=3.6,g=1.55,sum=0.0 (e/d) (e/d) (f/2) (f/2) ( ) ( ) Did you get them all right? Did you get them all right? You’re playing with type and internal representation! You’re playing with type and internal representation!

CS221 F'07 15Course Overview What about the following? sum = 0.0; for(int i=0; i<100; i++) sum=sum+g; System.out.println(“sum=“+sum); What Prints? What Prints? sum= sum= Why? Why?

CS221 F'07 16Course Overview ADT The built-in types don’t cover all our needs. The built-in types don’t cover all our needs. Most modern languages allow us to define an Abstract Data Type. Most modern languages allow us to define an Abstract Data Type. We define We define The type name. The type name. The permitted values. The permitted values. The permitted operations (methods) The permitted operations (methods) Often, one of the first things to design for a solution are a set of Abstract Data Types. Often, one of the first things to design for a solution are a set of Abstract Data Types. We’ll do this often in this course. We’ll do this often in this course.