2.1-ADT - CMPT 225 Unit 2 Abstract Data Type(ADT CMPT 225...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPT 225 Unit 2 Abstract Data Type (ADT)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPT 225 ADT versus non-ADT - Example 2
Background image of page 2
CMPT 225 So, an ADT is … • Result of abstraction • Hence Abstract data type • Data type defined by • Its underlying data (underlying data structure) • Its operations • Example: • Result of encapsulation • What -> public interface • How -> implementation (information hiding)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CMPT 225 The Two Parts of an ADT 1. Public Interface ( Specifications) What a client code (such as a driver) using the ADT class needs to know in order to use it ADT operations • signature • description • pre and postconditions • etc… 2. Implementation Data and data structure • actual representation of the attributes Method implementation It is “private” • only the implementer of the ADT class needs to know the details of exactly how the data is represented, and how the basic operations manipulating the data are implemented
Background image of page 4
CMPT 225 Composition of ADT • An ADT is composed of
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/29/2012 for the course CMPT 225 taught by Professor Annelavergne during the Summer '07 term at Simon Fraser.

Page1 / 11

2.1-ADT - CMPT 225 Unit 2 Abstract Data Type(ADT CMPT 225...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online