SlideShare a Scribd company logo
1 of 14
Abstract
Data
Type
Abstract Data Type(ADT)
Abstract
Data
Type
Abstract Data Type(ADT) is a data type, where only behavior is defined but not
implementation.
Opposite of ADT is Concrete Data Type (CDT), where it contains an
implementation of ADT
In computer science, an abstract data type (ADT) is a mathematical model for a
certain class of data structures that have similar behavior; or for certain data
types of one or more programming languages that have similar semantics. An
abstract data type is defined indirectly, only by the operations that may be
performed on it and by mathematical constraints on the effects (and possibly
cost) of those operations.
Abstract Data Type(ADT)
Abstract
Data
Type
Abstract
Data
Type
Abstract
Data
Type
Examples:
Array, List, Map, Queue, Set, Stack, Table, Tree, and Vector are ADTs.
Each of these ADTs has many implementations i.e. CDT.
The container is a high-level ADT of above all ADTs.
For example, lets see specifications of some Abstract Data Types,
List Abstract Data Type:
initialize(), get(), insert(), remove(), etc.
Stack Abstract Data Type:
push(), pop(), peek(), isEmpty(), isNull(), etc.
Queue Abstract Data Type:
enqueue(), dequeue(), size(), peek(), etc.
Abstract
Data
Type
Abstract
Data
Type
The first thing that we need to consider when writing programs is the problem.
However, the problems that we asked to solve in real life are often nebulous or
complicated. Thus we need to distill such as system down to its most fundamental
parts and describe these parts in a simple, precise language.
This process is called abstraction. Through abstraction, we can generate a model
of the problem, which defines an abstract view of the problem.
Normally, the model includes the data that are affected and the operations that
are required to access or modify
Abstraction
Abstract
Data
Type
As an example, consider a program that manages the student records.
The head of the school comes to you and asks you to create a program which
allows to administer the students in a class.
Well, this is too vague a problem.
• We need to think about, for example, what student information is needed for
the record?
• What tasks should be allowed?
Another Example
Abstract
Data
Type
There are many properties we could think of about a student, such as name, DOB,
SSN, ID, major, email, mailing address, transcripts, hair color, hobbies, etc. Not all
these properties are necessary to solve the problem. To keep it simple, we
assume that a student's record includes the following fields: (1) the student's
name and (2) ID. The three simplest operations performed by this program
include (1) adding a new student to the class, (2) searching the class for a student,
given some information of the student, and (3) deleting a student who has
dropped the class. These three operations can be furthermore defined as below:
ADD (stu_record): This operation adds the given student record to the collection
of student records.
SEARCH (stu_record_id): This operation searches the collection of student
records for the student whose ID has been given.
DELETE (stu_record_id): This operation deletes the student record with the given
ID from the collection.
Abstract
Data
Type
Now, we have modeled the problem in its most abstract form: listing the types of
data we are interested in and the operations that we would like to perform on the
data. We have not discussed anything about how these student records will be
stored in memory and how these operations will be implemented. This kind of
abstraction defines an abstract data type (ADT).
Abstract
Data
Type
An ADT is a mathematical model of a data structure that specifies the type
of data stored, the operations supported on them, and the types of parameters
of the operations. An ADT specifies what each operation does, but not how it
does it. Typically, an ADT can be implemented using one of many different data
structures. A useful first step in deciding what data structure to use in a program
is to specify an ADT for the program
Definition of ADT
Abstract
Data
Type
Understand and clarify the nature of the target information unit.
Identify and determine which data objects and operations to include in the
models.
Express this property somewhat formally so that it can be understood and
communicate well.
Translate this formal specification into proper language. In C++, this becomes a .h
file. In Java, this is called "user interface".
Upon finalized specification, write necessary implementation. This includes
storage scheme and operational detail. Operational detail is expressed as
separate functions (methods).
Steps of building ADT to data structures are:
Abstract
Data
Type
Stack — Abstract Data Type
Abstract
Data
Type

More Related Content

What's hot (20)

Database programming
Database programmingDatabase programming
Database programming
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
Java – lexical issues
Java – lexical issuesJava – lexical issues
Java – lexical issues
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
 
Python GUI
Python GUIPython GUI
Python GUI
 
OOAD
OOADOOAD
OOAD
 
Association agggregation and composition
Association agggregation and compositionAssociation agggregation and composition
Association agggregation and composition
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
 
Sum of subsets problem by backtracking 
Sum of subsets problem by backtracking Sum of subsets problem by backtracking 
Sum of subsets problem by backtracking 
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
 
Ooad
OoadOoad
Ooad
 

Similar to Adt

chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptxchapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptxAmrutaNavale2
 
Introduction to Data Abstraction
Introduction to Data AbstractionIntroduction to Data Abstraction
Introduction to Data AbstractionDennis Gajo
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS Adams Sidibe
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2RajSingh734307
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdfgm6523
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdNimmi Weeraddana
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbmsAnjaan Gajendra
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its FundamentalsHitesh Mohapatra
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfAxmedcarb
 
software_engg-chap-03.ppt
software_engg-chap-03.pptsoftware_engg-chap-03.ppt
software_engg-chap-03.ppt064ChetanWani
 
Data structure
Data structureData structure
Data structureMohd Arif
 
Data structures and Alogarithims
Data structures and AlogarithimsData structures and Alogarithims
Data structures and AlogarithimsVictor Palmar
 

Similar to Adt (20)

chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptxchapter 1 Introduction to Ds and Algorithm Anyasis.pptx
chapter 1 Introduction to Ds and Algorithm Anyasis.pptx
 
Introduction to Data Abstraction
Introduction to Data AbstractionIntroduction to Data Abstraction
Introduction to Data Abstraction
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
 
Iare ds lecture_notes_2
Iare ds lecture_notes_2Iare ds lecture_notes_2
Iare ds lecture_notes_2
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
1- Introduction.pptx.pdf
1- Introduction.pptx.pdf1- Introduction.pptx.pdf
1- Introduction.pptx.pdf
 
Lect 1-2 Zaheer Abbas
Lect 1-2 Zaheer AbbasLect 1-2 Zaheer Abbas
Lect 1-2 Zaheer Abbas
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
 
Lect 1-2
Lect 1-2Lect 1-2
Lect 1-2
 
Dbms1
Dbms1Dbms1
Dbms1
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
 
Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 
software_engg-chap-03.ppt
software_engg-chap-03.pptsoftware_engg-chap-03.ppt
software_engg-chap-03.ppt
 
Data structure
Data structureData structure
Data structure
 
Data structures and Alogarithims
Data structures and AlogarithimsData structures and Alogarithims
Data structures and Alogarithims
 
Lec1
Lec1Lec1
Lec1
 
Lec1
Lec1Lec1
Lec1
 
Ch08
Ch08Ch08
Ch08
 

More from MrSaem

pseudocode practice.pptx
pseudocode practice.pptxpseudocode practice.pptx
pseudocode practice.pptxMrSaem
 
Python Functions.pptx
Python Functions.pptxPython Functions.pptx
Python Functions.pptxMrSaem
 
Backus Naur Form.pptx
Backus Naur Form.pptxBackus Naur Form.pptx
Backus Naur Form.pptxMrSaem
 
3 Monitoring and control.pptx
3 Monitoring and control.pptx3 Monitoring and control.pptx
3 Monitoring and control.pptxMrSaem
 
6 The digital divide.pptx
6 The digital divide.pptx6 The digital divide.pptx
6 The digital divide.pptxMrSaem
 
Chapter 6 Python Fundamentals.pptx
Chapter 6 Python Fundamentals.pptxChapter 6 Python Fundamentals.pptx
Chapter 6 Python Fundamentals.pptxMrSaem
 
Chapter 8 system soft ware
Chapter 8 system soft wareChapter 8 system soft ware
Chapter 8 system soft wareMrSaem
 
Recursion
RecursionRecursion
RecursionMrSaem
 

More from MrSaem (8)

pseudocode practice.pptx
pseudocode practice.pptxpseudocode practice.pptx
pseudocode practice.pptx
 
Python Functions.pptx
Python Functions.pptxPython Functions.pptx
Python Functions.pptx
 
Backus Naur Form.pptx
Backus Naur Form.pptxBackus Naur Form.pptx
Backus Naur Form.pptx
 
3 Monitoring and control.pptx
3 Monitoring and control.pptx3 Monitoring and control.pptx
3 Monitoring and control.pptx
 
6 The digital divide.pptx
6 The digital divide.pptx6 The digital divide.pptx
6 The digital divide.pptx
 
Chapter 6 Python Fundamentals.pptx
Chapter 6 Python Fundamentals.pptxChapter 6 Python Fundamentals.pptx
Chapter 6 Python Fundamentals.pptx
 
Chapter 8 system soft ware
Chapter 8 system soft wareChapter 8 system soft ware
Chapter 8 system soft ware
 
Recursion
RecursionRecursion
Recursion
 

Recently uploaded

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Adt

  • 2. Abstract Data Type Abstract Data Type(ADT) is a data type, where only behavior is defined but not implementation. Opposite of ADT is Concrete Data Type (CDT), where it contains an implementation of ADT In computer science, an abstract data type (ADT) is a mathematical model for a certain class of data structures that have similar behavior; or for certain data types of one or more programming languages that have similar semantics. An abstract data type is defined indirectly, only by the operations that may be performed on it and by mathematical constraints on the effects (and possibly cost) of those operations. Abstract Data Type(ADT)
  • 5. Abstract Data Type Examples: Array, List, Map, Queue, Set, Stack, Table, Tree, and Vector are ADTs. Each of these ADTs has many implementations i.e. CDT. The container is a high-level ADT of above all ADTs. For example, lets see specifications of some Abstract Data Types, List Abstract Data Type: initialize(), get(), insert(), remove(), etc. Stack Abstract Data Type: push(), pop(), peek(), isEmpty(), isNull(), etc. Queue Abstract Data Type: enqueue(), dequeue(), size(), peek(), etc.
  • 7. Abstract Data Type The first thing that we need to consider when writing programs is the problem. However, the problems that we asked to solve in real life are often nebulous or complicated. Thus we need to distill such as system down to its most fundamental parts and describe these parts in a simple, precise language. This process is called abstraction. Through abstraction, we can generate a model of the problem, which defines an abstract view of the problem. Normally, the model includes the data that are affected and the operations that are required to access or modify Abstraction
  • 8. Abstract Data Type As an example, consider a program that manages the student records. The head of the school comes to you and asks you to create a program which allows to administer the students in a class. Well, this is too vague a problem. • We need to think about, for example, what student information is needed for the record? • What tasks should be allowed? Another Example
  • 9. Abstract Data Type There are many properties we could think of about a student, such as name, DOB, SSN, ID, major, email, mailing address, transcripts, hair color, hobbies, etc. Not all these properties are necessary to solve the problem. To keep it simple, we assume that a student's record includes the following fields: (1) the student's name and (2) ID. The three simplest operations performed by this program include (1) adding a new student to the class, (2) searching the class for a student, given some information of the student, and (3) deleting a student who has dropped the class. These three operations can be furthermore defined as below: ADD (stu_record): This operation adds the given student record to the collection of student records. SEARCH (stu_record_id): This operation searches the collection of student records for the student whose ID has been given. DELETE (stu_record_id): This operation deletes the student record with the given ID from the collection.
  • 10. Abstract Data Type Now, we have modeled the problem in its most abstract form: listing the types of data we are interested in and the operations that we would like to perform on the data. We have not discussed anything about how these student records will be stored in memory and how these operations will be implemented. This kind of abstraction defines an abstract data type (ADT).
  • 11. Abstract Data Type An ADT is a mathematical model of a data structure that specifies the type of data stored, the operations supported on them, and the types of parameters of the operations. An ADT specifies what each operation does, but not how it does it. Typically, an ADT can be implemented using one of many different data structures. A useful first step in deciding what data structure to use in a program is to specify an ADT for the program Definition of ADT
  • 12. Abstract Data Type Understand and clarify the nature of the target information unit. Identify and determine which data objects and operations to include in the models. Express this property somewhat formally so that it can be understood and communicate well. Translate this formal specification into proper language. In C++, this becomes a .h file. In Java, this is called "user interface". Upon finalized specification, write necessary implementation. This includes storage scheme and operational detail. Operational detail is expressed as separate functions (methods). Steps of building ADT to data structures are: