abstract data types
DESCRIPTION
Abstract Data Types. Modularity manage complexity enable maintenance Two Components Set of data structures Set of operations on those data structures Answers Two Questions What do I know What can I do. Key Ideas. What do I know? Length & Width What can I do? Accessors Set width - PowerPoint PPT PresentationTRANSCRIPT
Abstract Data Types
Key Ideas
Modularity◦manage complexity◦enable maintenance
Two Components◦Set of data structures◦Set of operations on those data structures
Answers Two Questions◦What do I know◦What can I do
An Example: Rectangle (ex 33)
What do I know?◦Length & Width
What can I do?◦Accessors
Set width Set length
◦Mutators Get width Get length Get area
More Complex Example: Array (ex 34)
◦What do I know My size My type My contents
◦What can I do Create myself
◦Constructor Destroy myself
◦Destructor Display myself Insert an item into a position Remove an item from a position Get an item from a position Find the largest item