What is Abstract Data Types (ADTs)?
I am writing this post for whoever looking at the exact purpose of ADTs and the difference between ADTs, Datatypes and Abstract classes.
Before we float to the concept of ADTs, we all need to know about the following things:
- Purpose of the Computer
- Real Meaning of ADTs
- Data Types vs ADTs
- ADTs vs Abstract Class
- Exploring ADTs via python snippets
1. Purpose of the Computer
A computer is an electronic device. It is used for problem-solving via computation based on mathematical operations.
2. Real Meaning of ADTs
ADTs are logical views of any mathematical model. Generally, we will use the computer to solve the problems. To solve a problem using a computer, we need to design a mathematical model.
- For an example
- The perfect squares (4,9,16,25,36,49,64,81,100,…,)
- logical sequence
- get a square value
- divide by the number 2
- if the remainder is zero
- the given number is a perfect square
- the given number is not a perfect square
3. Datatypes vs ADTs
- Datatypes are the combination of both physical and logical views, but ADTs are the logical views of any mathematical model.
4.ADTs vs Abstract Class
- ADTs are model, that shows the behaviour of the model. But Abstract Class is a type, that does not provide any definition.
5. Exploring ADTs via Python Snippets