Difference between Abstract and Concrete Data Structure
In this article we will discuss the differences between Abstract and Concrete data structure or type.
Abstract Data Types(ADT) :
It is a type (or class) of objects whose behaviour is defined by a set of values and a set of operations. The user interacts with the interface, using the operations that have been specified by the abstract data type. It offers a high level use of a concept independent of it’s implementation. They package data structure and operations on them hiding internal details.
Examples –
Use a class with private data and public functions to represent the record.
public class date
{
private int day;
private string month;
private int year;
};
public void increment ()
{
return day;
}
Concrete Data Types(CDT) :
A concrete data type is the opposite of an abstract data type. It is a specialized solution-oriented data type that represents a well-defined single solution domain concept. A concrete data type is rarely reusable beyond its original use, but can be embedded or composed with other data types to form larger data types. They are direct implementations of a relatively simple concept. It does not hide anything.
Examples –
Use a struct with public data and no functions to represent the record
struct date
{
int day;
string month;
int year;
};
Difference Between Class And Object :
There are many differences between object and class. Some differences between object and class are given below:
S. No. |
Abstract Data Types or structure (ADT)
|
Concrete Data Types or structure (CDT)
|
1 |
Abstract Data Types or structures describe the data and the operations to manipulate and change it. |
Concrete data types or structures provide how these operations are actually implemented. |
2 |
Most of the program becomes independent of the abstract data types representation, so it can be improved without breaking the program. |
Which is not possible in Concrete Data Types or structure (CDT) |
3 |
It’s easier for each part of a program to use an implementation of its data types and that will be more efficient. |
It is not so efficient compared to ADT. |
4 |
Implementation of a high level concept |
Implementation of a simple concept |
5 |
It is usable beyond its original use. |
It is rarely reusable beyond its original use. |
6 |
It hides the internal details. |
It doesn’t hide anything. |
7 |
It uses class. |
It uses structure. |
8 |
Examples- lists, sets, stacks. |
Examples-Arrays, linked lists, trees, graphs. |
Last Updated :
15 Jun, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...