Lecture 3 Abstract Data Type Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.

Slides:



Advertisements
Similar presentations
Lecture 4 Sending and Receiving Messages Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Advertisements

Chapter 17 Templates. Generic Algorithms Algorithms in which the actions or steps are defined, but the data types of the items being manipulated are not.
CSCI 311 – Algortihms and Data Structures Steve Guattery Dana 335a (department office) x7-3828
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Lecture 2b Sockets Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Lecture 5 Stack Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Lecture 1 Introduction to Java Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Lecture 11 Binary Search Tree Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Introduction to C# Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
General Computer Science for Engineers CISC 106 Lecture 19 Dr. John Cavazos Computer and Information Sciences 04/06/2009.
1 Chapter 11 Structured Types, Data Abstraction and Classes Dale/Weems/Headington.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
Lecture 9 Concepts of Programming Languages
1 The first step in understanding pointers is visualizing what they represent at the machine level. In most modern computers, main memory is divided into.
Basic Concepts Chapter 1 Objectives
Multiplication and Division Equations SWBAT solve multiplication equations using the division property of equality; solve division equations using the.
Chapter 3 Data Structures and Abstract Data Type Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
4.1 Solving Linear Inequalities
1 Chapter Structured Types, Data Abstraction and Classes Dale/Weems.
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Data Structures and Algorithms Lecture 3 Instructor: Quratulain Date: 8 th September, 2009.
Solving Equations Medina1 Variables on Both Sides.
Evaluating a Variable Expression To evaluate a variable expression:
A first look an ADTs Solving a problem involves processing data, and an important part of the solution is the careful organization of the data In order.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Data Abstaraction Chapter 10.
Solving Inequalities Using Addition & Subtraction.
Abstraction ADTs, Information Hiding and Encapsulation.
Lecture 7 Priority Queue Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Solving Equations Medina1 Multi-Step Equations. Steps to solve Medina2 3. Use inverse of addition or subtraction You may not have to do all the steps.
Jeopardy Solving Equations Add and Subtract Multiply and Divide Multi-Step Variables on each side Grouping Symbols $100 $200 $300 $400 $500 $100 $200.
CIS 270—Application Development II Chapter 8—Classes and Objects: A Deeper Look.
One step equations Add Subtract Multiply Divide  When we solve an equation, our goal is to isolate our variable by using our inverse operations.  What.
Lesson 1-8 Solving Addition and Subtraction Equations.
Lesson 2 Contents Example 1Solve a Two-Step Equation Example 2Solve Two-Step Equations Example 3Solve Two-Step Equations Example 4Equations with Negative.
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
Solve one step equations. You can add the same amount to both sides of an equation and the statement will remain true = = 9 x = y +
Data Structure and Algorithm: CIT231 Lecture 3: Arrays and ADT DeSiaMore DeSiaMorewww.desiamore.com/ifm1.
2.2 Solving Two- Step Equations. Solving Two Steps Equations 1. Use the Addition or Subtraction Property of Equality to get the term with a variable on.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION ABSTRACT DATA TYPES Autumn 2011.
M180: Data Structures & Algorithms in Java Stacks Arab Open University 1.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Lecture.
1 Classes and Data Abstraction Chapter What a Class ! ! Specification and implementation Private and public elements Declaring classes data and.
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.
1 Chapter 12 Classes and Abstraction. 2 Chapter 12 Topics Meaning of an Abstract Data Type Declaring and Using a class Data Type Using Separate Specification.
Advanced Data Structures Lecture 1
Jeopardy Solving Equations
Chapter 12 Classes and Abstraction
10.2 Classes Copyright © 2008 Pearson Addison-Wesley. All rights reserved. 1.
ONE STEP EQUATIONS.
ONE STEP EQUATIONS.
Bell Ringer.
Warm up 11/1/ X ÷ 40.
Solving 1-Step Integer Equations
Abstraction Functions and Representation Invariants
Problem-Solving Steps Solve Problem-Solving Steps Solve
6-3 Solving Systems Using Elimination
EQ: How do I solve an equation in one variable?
1.3 Solving Linear Equations
Solving Two-Step Equations Lesson 2-2 Learning goal.
Divide the number in C by 10.
Splash Screen.
Abstract Data Types, Elementary Data Structures and Arrays
Bell Ringer.
Assignment Questions? Pg #13- (-2, 1) #14- (3, -4) #16- (-4, 6) # T-Shirts #50- (3, 3) #53- No Solution #54- (-5, -3) #58- Infinite Solutions.
ONE STEP EQUATIONS WHAT?!?!.
ONE STEP EQUATIONS.
ONE STEP EQUATIONS.
Presentation transcript:

Lecture 3 Abstract Data Type Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1

» Problem Solving is different from coding ˃Algorithm ˃Documentation ˃Code » Algorithm and Documentation is Abstract Layer » Code is Implementation Layer 2 © Sekolah Tinggi Teknik Surabaya

» Abstraction is important to ˃Improve Readablity ˃Organize Data through Encapsulation » Abstract Data Type (ADT) ˃an object with a generic description independent of implementation details ˃we think about what can be done with the data, not how it is done 3 © Sekolah Tinggi Teknik Surabaya

» ADT abstracts away from a specific representation to focus on the semantic meaning of the data » In what sense are the following two definitions different? » Although the representations differ, the client should instead consider a Point as a set of operations to create and manipulate 2D points on the plane » By restricting the client to only call operations to access data, the potential for modifying the representation (and supporting algorithms) remains 4 © Sekolah Tinggi Teknik Surabaya

» The only operations on objects of the type are those provided by the abstraction » The implementation is hidden 5 © Sekolah Tinggi Teknik Surabaya

6

» An implementation of ADT consists of storage structures to store the data items and algorithms for basic operation 7 © Sekolah Tinggi Teknik Surabaya

» Consider example of an airplane flight with 10 seats to be assigned » Tasks ˃List available seats ˃Reserve a seat » How to store, access data?

» Consider example of an airplane flight with 10 seats to be assigned » Tasks ˃List available seats ˃Reserve a seat » How to store, access data? ˃10 individual variables

» Algorithm to List available seats 1. If seat1 == ‘ ’: display 1 2. If seat2 == ‘ ’: display If seat10 == ‘ ’: display 10 » Algorithm to Reserve a seat 1. Set DONE to false 2. If seat1 ==‘ ’: print “do you want seat #1??” Get answer if answer==‘Y’: set seat1 to ‘X’ set Done to True 3. If seat2 ==‘ ’: print “do you want seat #2??” Get answer if answer==‘Y’: set seat2 to ‘X’ set Done to True.

» Consider example of an airplane flight with 10 seats to be assigned » Tasks ˃List available seats ˃Reserve a seat » How to store, access data? ˃10 individual variables ˃An array of variables

» Algorithm to List available seats For number ranging from 0 to max_seats-1, do: If seat[number] == ‘ ’: Display number » Algorithm to Reserve a seat Read in number of seat to be reserved If seat[number] is equal to ‘ ’: set seat[number] to ‘X’ Else Display a message that the seat having this number is occupied

» Develop a USD ADT ˃Properties +dollar: int +cent: int ˃Methods +Add +Subtract +Multiply +Divide +ToString 13 © Sekolah Tinggi Teknik Surabaya

» Abstract Data Type, e, accessed on March 24 th e » Abstract Data Types, ml, accessed on March 24 th ml » Dr. Bernard Chen Ph.D., Data Structures and Abstract Data Type, © Sekolah Tinggi Teknik Surabaya