0% found this document useful (0 votes)
75 views10 pages

Abstract Data Type

Uploaded by

Prem Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views10 pages

Abstract Data Type

Uploaded by

Prem Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Abstract Data Type

Dr. Nitin Paharia


Associate Professor
PSIT
Software Engineering Perspectives
Safe from bugs Easy to understand Ready for change

Correct today and Communicating Designed to


correct in the clearly with future accommodate
unknown future. programmers, change without
including future you. rewriting.
Abstraction
• In general, abstraction is a creative process of focusing
attention on the main problems by ignoring lower-level
details.
• For example- when drawing sketch of cat, the focus is
on general characteristics of cat required for sketch and
ignoring specific details of cat.
Types of Abstraction in
programming
• In programming, there are two kinds of abstraction:
• procedural abstraction - A procedural abstraction is a
mental model of what we want a subprogram to do
(but not how to do it).
• data abstraction - Data abstraction works much the
same way. A data abstraction is a mental model
of what can be done to a collection of data. It
deliberately excludes details of how to do it.
Data Abstraction
• A data abstraction is a mental model. It’s not enough to
start programming with. The evolution from mental
model to implemented code proceeds in two steps:
• We devise an ADT interface for the data abstraction that
describes what we want to do with it.
• We implement the data abstraction by
• choosing an appropriate data structure - a specific construction of data,
and
• providing appropriate operations (algorithms) to manipulate that data.
Abstract Data Type
• An 'Abstract Data Type' (ADT) is a concept in computer
science that serves as an abstract description of a data
object and its associated operations.
• Definition- In computer science, an abstract data type is
a mathematical model for data types, defined by its
behavior from the point of view of a user of the data,
specifically in terms of possible values, possible
operations on data of this type, and the behavior of
these operations
Purpose of ADT
• ADT enable us to separate how we use a data structure in a
program from the particular form of the data structure itself.
• Abstract data types address a particularly dangerous
problem: clients making assumptions about the type’s
internal representation
• Critically, a good ADT should be representation independent.
• This means that the use of an abstract type is independent of its representation (the
actual data structure or data fields used to implement it), so that changes in
representation have no effect on code outside the abstract type itself.
• For example, the operations offered by List are independent of whether the list is
represented as a linked list or as an array.
Purpose of ADT
Levels of Abstraction in
Programming
Other
• Abstraction. Omitting or hiding low-level details with a simpler, higher-
level idea.
• Modularity. Dividing a system into components or modules, each of
which can be designed, implemented, tested, reasoned about, and reused
separately from the rest of the system.
• Encapsulation. Building a wall around a module (a hard shell or capsule)
so that the module is responsible for its own internal behavior, and bugs in
other parts of the system can’t damage its integrity.
• Information hiding. Hiding details of a module’s implementation from
the rest of the system, so that those details can be changed later without
changing the rest of the system.
• Separation of concerns. Making a feature (or “concern”) the
responsibility of a single module, rather than spreading it across multiple
modules.

You might also like