Data Structures and Algorithms for Information Processing

Slides:



Advertisements
Similar presentations
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advertisements

Written by: Dr. JJ Shepherd
George Blank University Lecturer.
Chapter 1. The Phases of Software Development. Data Structure 2 Chapter outline  Objectives  Use Javadoc to write a method’s complete specification.
Software Engineering and Design Principles Chapter 1.
Reviews for Exam 1 Chapter 1-4 CSc 212 Data Structures, Sec FG CCNY, Fall 2010.
Reviews for Exam 1 Chapter 1-4 CS 211 Data Structures MHC, 2007.
Programming Languages Structure
Chapter 10 Classes Continued
Subclasses and Subtypes CMPS Subclasses and Subtypes A class is a subclass if it has been built using inheritance. ▫ It says nothing about the meaning.
Data Structures and Programming.  John Edgar2.
Introduction CSE 1310 – Introduction to Computers and Programming
Review for Midterm Chapter 1-9 CSc 212 Data Structures.
Java: Chapter 1 Computer Systems Computer Programming II.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CS Fall 2007 Dr. Barbara Boucher Owens. CS 2 Text –Main, Michael. Data Structures & Other Objects in Java Third Edition Objectives –Master building.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CSE 373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks; Eclipse.
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.
P Chapter 2 introduces Object Oriented Programming. p OOP is a relatively new approach to programming which supports the creation of new data types and.
Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Data Structures Using C++ 2E
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 1: Introduction Data.
Ordered Linked Lists using Abstract Data Types (ADT) in Java Presented by: Andrew Aken.
Protocols Software Engineering II Wirfs Brock et al, Designing Object-Oriented Software, Prentice Hall, Mitchell, R., and McKim, Design by Contract,
Class Design I Class Contracts Readings: 2 nd Ed: Section 9.5, Advanced Topic nd Ed: Section 8.5, Advanced Topic 8.2 Some ideas come from: “Practical.
Week 5 - Wednesday.  What did we talk about last time?  Recursion  Definitions: base case, recursive case  Recursive methods in Java.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
CSSE501 Object-Oriented Development. Chapter 10: Subclasses and Subtypes  In this chapter we will explore the relationships between the two concepts.
CSC 205 Java Programming II Introduction. Topics Syllabus Course goals and approach Review I Java language fundamentals.
1 Introduction 1. Why Data Structures? 2. What AreData Structure? 3. Phases of Software Development 4. Precondition and Postcondition 5. Examples.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
CS 367 Introduction to Data Structures Charles N. Fischer Fall s367.html.
CSE 373 Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks; Eclipse.
Chapter 1 The Phases of Software Development. Software Development Phases ● Specification of the task ● Design of a solution ● Implementation of solution.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
XuanTung Hoang 1 Something to discuss Feedbacks on Midterm Exam Final exam and term project  Final exam requires solid knowledge/skills in Java  Be more.
Lecture No.05 Data Structures Dr. Sohail Aslam.  Josephus Problem #include "CList.cpp" void main(int argc, char *argv[]) { CList list; int i, N=10, M=3;
Advanced Data Structures Lecture 1
Principles of Programming & Software Engineering
CSCE 210 Data Structures and Algorithms
CSC 222: Computer Programming II
DDC 2423 DATA STRUCTURE Main text:
C++ Plus Data Structures
Chapter No. : 1 Introduction to Java.
CSC 221: Computer Programming I Spring 2010
CSC 221: Computer Programming I Fall 2005
Principles of Programming and Software Engineering
Stacks.
About the Presentations
Chapter 1-4 CSc 212 Data Structures, Sec AB CCNY, Spring 2012
Section 11.1 Class Variables and Methods
CS 583 Fall 2006 Analysis of Algorithms
Introduction to Data Structures
Introduction CSE 373 Data Structures.
Data Abstraction David Evans cs205: engineering software
CS 200 Primitives and Expressions
Review CSE116 2/21/2019 B.Ramamurthy.
Administrivia- Introduction
Introduction to Data Structure
Programming Languages and Paradigms
Algebraic Specification Software Specification Lecture 34
CS2013 Lecture 7 John Hurley Cal State LA.
Administrivia- Introduction
Chapter 1-4 CSc 212 Data Structures, Sec FG CCNY, 2009
Lecture 4 – Data collection List ADT
CMPT 225 Lecture 7 – Stack.
Presentation transcript:

Data Structures and Algorithms for Information Processing Lecture 1: Introduction Lecture 1: Introduction

Lecture 1: Introduction Course Web Site http://www.andrew.cmu.edu/~mm6 Lecture 1: Introduction

Structure of the Course Lectures / class participation Homeworks (programming) Quizzes (low score dropped) Midterm examination Final examination Lecture 1: Introduction

Lecture 1: Introduction Readings Readings from the required text are assigned for each lecture -- read them in advance The book contains self-test exercises in each section Work these exercises (especially if you are new to the material) Lecture 1: Introduction

Lecture 1: Introduction Grading Homework (5-6) 50% Quizzes (5) 5% Midterm Exam 20% Final Exam 25% Lecture 1: Introduction

Lecture 1: Introduction Definitions A data structure is an organized collection of data with specific aggregate properties An algorithm is a sequence of program instructions designed to compute a particular result Lecture 1: Introduction

Five Steps per Datatype Understand it Abstractly Write a Specification Write Applications Select an existing, or Design and Implement our own Analyze the Implementation in terms of performance Lecture 1: Introduction

Lecture 1: Introduction Abstract vs. Concrete An abstract data type (ADT) specifies behavior, but not implementation An implementation uses a particular low-level datatype to implement the desired behavior Lecture 1: Introduction

Lecture 1: Introduction Quick Example A stack is an abstract data type (ADT). We push and pop from the top. Consider three implementations: (1) Every push causes all elements in an array to shift down 1 before the insertion at s[0]. (2) We add at stackTop and then add one to stackTop. (3) A linked list use where the top is always at the list’s front end. Each implementation can be written correctly. Implementation (1) runs in Θ(n). Implementations (2) and (3) run in Θ(1). Lecture 1: Introduction

Lecture 1: Introduction Step 1: Understanding Grasp the datatype at the level of concepts and pictures e.g., visualize a stack and the operations of pushing / popping Understand simple applications Simulate by hand e.g., use a stack to reverse the order of letters in a word Lecture 1: Introduction

Lecture 1: Introduction Step 2: Specification Write a specification for a Java class that could implement the datatype (see javadoc Appendix H) Headings for constructor, public methods, public features Includes precondition / postcondition for each method Independent of implementation! Lecture 1: Introduction

Lecture 1: Introduction Step 3: Application Based on the specification, write small applications to illustrate the use of the datatype “Test the specification” prior to implementation Code not yet compiled / run Lecture 1: Introduction

Lecture 1: Introduction Step 4: Implementation Select appropriate data structure Implement as private class vars Write rules relating instance variables to abstract specification: the invariant of the ADT Each method knows the invariant is true when it starts Each method upholds the invariant Lecture 1: Introduction

Lecture 1: Introduction Step 5: Analysis Correctness Flexibility When possible, compare different implementations of the same ADT Time Analysis number of operations big-O notation, e.g., Lecture 1: Introduction

Phases of Software Development Specification of the Task Design of a Solution Implementation of the Solution Running Time Analysis Testing and Debugging Maintenance and Evolution Obsolescence Lecture 1: Introduction

Lecture 1: Introduction Java Conceived in 1991 at Sun Has Similarities to C++ Is simpler than C++ Object-Oriented Programming (OOP) information hiding component re-use programs (methods) and data are grouped together into classes we will not be using the collection classes Lecture 1: Introduction

What You Should Know Already How to use a Java development environment (java, javac, javadoc) How to write, compile, and run short Java programs Java primitive types (number types, char, boolean) and arrays Easy to pick up with prior programming experience Lecture 1: Introduction

Specifying a Java Method Specification: what a method does not how it does it A form of information hiding called procedural abstraction Method signature public static double celsiusToFahrenheit(double c) Method call double fahrenheit = celsiusToFahrenheit(celsius); Lecture 1: Introduction

Elements of Specification Short Introduction Parameter Description Returns Specify the meaning of return value Throws list error conditions (exceptions) “thrown” by this method Precondition and Postcondition Lecture 1: Introduction

Lecture 1: Introduction Preconditions A precondition is a statement giving the condition that should be true when the method is called The method is not guaranteed to perform as it should unless the precondition is true. If violated, ignore (like c) or throw an exception (like Java). Lecture 1: Introduction

Lecture 1: Introduction Postconditions A postcondition is a statement describing what will be true when a method call completes If the method is correct and precondition was met, then the method will complete, and the postcondition will be true when it does. Lecture 1: Introduction

Example Specification celsiusToFahrenheit public static double celsiusToFahrenheit(double c) convert a temperature from Celsius degrees to Fahrenheit degrees Parameters: c - a temperature in Celsius degrees Precondition: c>= -273.16 Returns: temperature c in Fahrenheit Throws: IllegalArgument Exception Lecture 1: Introduction

More on Pre/Postconditions Slides from Main’s Lectures Lecture 1: Introduction