ADT: Abstract Data Type - PowerPoint PPT Presentation

About This Presentation
Title:

ADT: Abstract Data Type

Description:

Title: PowerPoint Last modified by: kophinus Document presentation format: Other titles: Times New Roman ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 16
Provided by: tist216
Category:
Tags: adt | abstract | data | type

less

Transcript and Presenter's Notes

Title: ADT: Abstract Data Type


1
2?. ?? ???
  • ????
  • ???? ??? ?? ?? ???? ???? ?? ??? ????.
  • ?? ???? ????? ???? ????.
  • ???? ??? ?? ???? ????? ??? ??? ????.
  • ??? ??, ?????? ? ??? ??? ????.

2
?? ???
  • ?????? ? ??? ??
  • ?? ???
  • ?? ???
  • ADT Abstract Data Type
  • ?? ??? ??
  • ?? ???
  • ????? ??? ?? ???? ??? ????? ??
  • ??? ???? ??? ???? ??
  • ??? ??? ?? ????
  • ??? ???? ??? ?? ????? ??? ????

3
?? ??? ??? ??? ??
  • ???? ???? ??
  • ???? ????? ???? ??.
  • ???? ????? ???? ?? ??.
  • ?????? ????? ??? ??? ??? ?? ??.

4
???? ??
  • ?? ???
  • Int x, char y -gt ??, ??, ? ??? ?? ??
  • ?? ???
  • ??? -gt ???, ??, ?? ??? ?? ??
  • ???
  • ?? ????? ?? ?? ??? ???? ?? ????.
  • ??? ????, ?? ????, ???? ??? ??? ??.
  • ??? ??? ????? ???? ??? ??? ?
  • ???
  • ????? ??? ? ?? ??? ??
  • ??? ??? ??, ??? ??? ??
  • ???? ???

5
???
  • ??? ???? ?

6
???
  • ?? ???? ???
  • ADT IceDispenser
  •       GetMeChilledWater( )   ?? ???.
  •       GetMeCrushedIce( )     ?? ?? ???.
  •       GetMeCubeIce( )        ?? ?? ???.

7
???
  • ??? ??? ???? ?.

8
??? ??
  • ??? ???? ?? ???? ??? ?? ??? ??
  • ADT IceDispenser
  • - Data
  •       Water, Motor, Button   ?, ??, ??
  • - Operation
  •        GetMeChilledWater( )   ?? ???? ???
    ??
  •                         
  •        GetMeCrushedIce( )     ?? ?? ????
    ??? ??
  •                  
  •        GetMeCubeIce( )        ?? ?? ????
    ??? ??
  •                   
  • ????
  • ?, ??, ?? ?? ??? ??
  • ???? ? ???? ??? ??? ??? ????? ?
  • ??? ?? ????? ??? ? ??? ???? ??? ??
  • ???(Structure)? ???? ??? ??(Array)? ????
  • ??? ????? ?????? ??? ??

9
?? ???? ?? ??
  • ??? ??? ??? ??? ?? ???

??? ??? ?? ??? ??? ??? ?? ???
???? ?? 1) ??? ??? ???? 2) ??? ?? ??? ??
10
?? ???? C ??
  • ????? ??? ????? ??
  • ?? ??(.h) ????? ??, ?? ??(.c) ?? ??
  • ?? ??? ?
  • typedef struct
  •   int Water    ?? ?         
  •    int Motor    ?? ???
  •     int Button   ?? 1, 2, 3
  • materialType
  • void GetMeChilledWater( )     ?? ???
  • void GetMeCrushedIce( )      ?? ?? ???
  • void GetMeCubeIce( )          ?? ?? ???
  • ?? ??
  • ?? ?????? ?? ?
  • ?? ??(??? ??, ??? ? ? ??)
  • ??? ??(??? ??? ???? ???? ??)
  • ??? ??
  • ??? ?? ???(Ice Dispencer)? ???? ??

11
?? ???? C ??
  • ??? ??
  • ??? ??? ??
  • ??? ???? ??? ??? ??
  • ????? ????? ??
  • ??? ??
  • ?? ??? ?? ??? ??
  • ?? ???? ?? ?? ???? ???

12
??????
  • ?? ??
  • ?? ?(Wall, Barrier)??? ??? ?? ??? ? ? ?? (??? ??)
  • ?? ?? ???? ?? ?? ?????? ????? ? ? ??
  • ?? ??? ?? ??? ?? ??? ??? ???
  • ?? ??
  • ?? ??? ??? ??? ???? ??
  • ?? ????? ????? ??? ???
  • ??? ??? ????? ??? ?? ?? ??? ??? ??

13
??????
14
?? ???? C ??
  • ?? ??? ?? ???
  • class IceDispenser                     ???
    ?? ???      
  • public
  •        void GetMeChilledWater( ) ?? ???
  •        void GetMeCrushedIce( )     ?? ??
    ???
  •        void GetMeCubeIce( )           ?? ??
    ???
  •   private
  •        int Water, Motor, Button       ???
    ??? ?? ??? ??
  • ?? ??? ?? ???? ??? ????? ??? ??? ??
  • GetMeCrushedIce( )? Water? ???? ???? ?? ??? ??

15
?? ??
  • ???? ?? ?? ??

?? ??? ADT Operation Collection of Data
?? ?? Program Algorithm Data Structure
???? ??? Class Message(Interface View) or Method(Implementation View) State Variable or Instance Variable
C     Member Function Member Data
Write a Comment
User Comments (0)
About PowerShow.com