Data Structure and Algorithm Chapter 2.ppt - Introduction...

This preview shows page 1 - 7 out of 52 pages.

Introduction to Abstract Data Type & C++ Revision
Objectives At the end of the class students are expected to: Understand Abstract Data Type concept Review C++ programming Declaring a class, data member and function member Creating constructor and destructor Pass object as function parameter Return object from a function Array of class Pointer to class Define and implement a class within header files and implementation files
Abstraction Abstract data type (ADT) A collection of data and a set of operations on the data You can use an ADT’s operations without knowing their implementations or how data is stored, if you know the operations’ specifications Abstraction Separates the purpose of a module from its implementation Specifications for each module are written before implementation
Abstraction and Information Hiding Data abstraction Focuses on the operations of data, not on the implementation of the operations Asks you to think what you can do to a collection of data independently of how you do it Allows you to develop each data structure in relative isolation from the rest of the solution A natural extension of functional abstraction Functional abstraction Separates the purpose of a module from its implementation
Abstraction and Information Hiding Information hiding Hide details within a module Ensure that no other module can tamper with these hidden details Makes these details inaccessible from outside the module Public view of a module Described by its specifications Private view of a module Implementation details that the specifications should not describe
Abstract data type (ADT) Abstract data type (ADT)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture