Abstract Data Types: Maria Cristina A. Magon
Abstract Data Types: Maria Cristina A. Magon
TYPES
DATA
OPERATIONS
Example:
When operating a car, the primary activities are steering,
accelerating, and braking. On nearly all passenger cars,
you steer by turning the steering wheel, accelerate by
pushing the gas pedal, and brake by pushing the brake
pedal. This design for cars can be viewed as an ADT
with operations "steer", "accelerate", and "brake". Two
cars might implement these operations in radically
different ways, say with different types of engine, or
front- versus rear-wheel drive. Yet, most drivers can
operate many different cars because the ADT presents a
uniform method of operation that does not require the
driver to understand the specifics of any particular
Example:
We apply the label "hard drive" to a collection of
hardware that manipulates data on a particular
type of storage device, and we apply the label
"CPU" to the hardware that controls execution of
computer instructions. These and other labels are
gathered together under the label "computer".
Because even the smallest home computers today
have millions of components, some form of
abstraction is necessary to comprehend how a
computer operates.