CMPUT 175 Lecture #4
CMPUT 175 Lecture #4
Introduction to Foundations
of Computing
ADT: Abstract Data Types
You don’t need to know You don’t need to know You don’t need to know
how the engine works, how calculators handle how the phone does
the mechanics of the operations in order to use establish connections and
gearbox, etc. in order to the calculator for even transmits voice in order
drive the car. complex reckoning. to use it.
You need to know You need to know You need to know how to
how to use the clutch how to operate the dial and where is the
speakerphone and the
and how to shift provided buttons and microphone, etc.
gears, etc. functions, etc.
January 29, 2024 © Osmar R. Zaïane : University of Alberta
Interface 8
Ford Model A
https://www.mecum.com/
Set
same as a bag, except duplicate elements are
not allowed
union, intersection, difference, subset
January 29, 2024 © Osmar R. Zaïane : University of Alberta 14
Example: Stacks
Collection with access only to the last
element inserted
New Data Data5
Push Pop
Private
state
external request
Public protocol
class