07 - Datatypes (HR - 2021) - Finalized
07 - Datatypes (HR - 2021) - Finalized
Algorithms
By
Hossein Rahmani
[email protected]
http://webpages.iust.ac.ir/h_rahmani/
1
Intro
Dynamic
Programming Sorting Hash Functions
2
Data Structure
• A construct that can be defined within a
programming language to store a collection of
data
– one may store some data in an array of integers,
an array of objects, or an array of arrays
Abstract Data Type (ADT)
• Definition: a collection of data together
with a set of operations on that data
– specifications indicate what ADT operations do,
but not how to implement them
– data structures are part of an ADT’s
implementation
• Programmer can use an ADT without
knowing its implementation.
Typical Operations on Data
• Add data to a data collection
• Remove data from a data collection
• Ask questions about the data in a data
collection. E.g., what is the value at a
particular location, and is x in the collection?
Why ADT
• Hide the unnecessary details
• Help manage software complexity
• Easier software maintenance
• Functionalities are less likely to change
• Localised rather than global changes
Data Abstraction
7
Illustration