Sie sind auf Seite 1von 7

ABSTRACTED DATA TYPE

It is a set of data with a set of definition ,that allows the programmer to


use the function while hiding the implementation of data.

Simply describe as follows:

1. Declaration of data.

2. Operation on data.

3. Encapsulation of data.

The main advantage of ADT(Abstracted data type) is the hiding of the


implementation of data from the user.
A simple ADT STRUCTURE can be drawn below:

AD

PRIVATE
PUBLIC
APPLICATIO
N
PROGRAM ARRAY
LINKED

CREATION OF ABSTRACTED DATA TYPE MEMORY AREA


RECORD

A abstracted data type can create using the following method

1. Using array implementation.


2. Using linked list implementation.

Lets look at each implementation.


1.Array implementation.

Array is a fixed size sequence collection of the elements of same data


type. Actually array is a particular size block, and each block contain
one element , may be a character(alphabet) or integer(0-9) or floating
point (eg-1.2,3.2,9.1) value , it may be a null block . but the size of the
array is fixed and can be change by the developer.

The following figure shows a normal array :

0 1 2 3 4

12 32 67 90 54

Here it is a array of size ‘4’ and contains ‘5’ element . the array size is
what the value of the total block-1. Because each array specification is
starting from ‘0’ , as shown in the picture

In this array the element of 0 block is 12

The element of 1 block is 32.

So that it can say as follows

Consider the name of the array is “ABS”


Then ABS[0]=12.

ABS[1]=32.

ABS[2]=67.

ABS[3]=90.

ABS[4]=54.

So this array is a size of ‘4’ , and can change only by the developer.

This is a one form of data structure.

LINKED LIST DATA STRUCTURE

Linked list data structure is same as that of array , but the huge
different is that it contains a lot of link between each array or
elements. It contains a lists and the links between each link.

The following image shown the linked list figure:

A B

12 4

3
Here it contains 3 lists A,B,C and the links between them are shown
as arrows. Each list is said to be a node. And the first column of the list
consist of the data , and the second column consist of the link. The
first node is said to be the “head” node , and the corresponding data
is known as “head data”. The other nodes can numbered using
1,2….as like array.

Head node

Head data head link


data link

Data Link

What is the need of abstracted data type

it is necessary to hide the implementation of the data type from the


user, so in this case we are using the abstracted data type .

using the abstracted data type we can create a different structure for
data type and link it with different functions.

Created by : Faizal

Date : 11/04/2010.

Email : faisalkt888@gmail.com

For more info :visit


http://www.idiotcomputer.blogspot.com

Das könnte Ihnen auch gefallen