Types of data structure details in c

 TYPES OF DATA STRUCTURE :

1. LOGICAL DATA STRUCTURE AND PHYSICAL DATA STRUCTURE :

Logical data structure 

The ADT is logical data structure because of it specifies the logical properties of the data type. Hence it is just a mathematical and abstract concept. Which defines the data type.

Physical data structure :

A physical data structure is the implemented ADT  which can be used to store element and performed operations.

2.  LINEAR AND NON- LINEAR DATA STRUCTURE :

Linear data structure

The elements in a linear data structure are arranged in line i .e they form a sequence or a list. There is a ordering among them such that there is a first element  second and so on . the elements have a one-to-one relationship with the other.

example : Array, linked list .

Non linear data structure:

In non linear data structure the relation having one -to-many ,many - to - many relationship between them the elements do not form a specific sequence .

example :tree, graph.  

3. STATIC AND DYNAMIC DATA STRUCTURE:

Static:

 The static data structure is one of the size of the data structure does not change during the entire program . The memory is allocated during compile time and remain allocated even when there are no elements in the data structure.                                                                                                                        example :Array.

Dynamic data structure :

In dynamic data structure the size of the data structure grows and shrinks as elements are added and removed dynamically i.e. during run time in most real time application we cannot predict the number of elements in advance and hence dynamic data structure are needed dynamic memory allocation is required in this case. 

SEQUENTIAL ORGANIZATION AND LINKED ORGANIZATION:

Sequential Organization:

 In a sequential organization data is stored in fixed distance. this means that if an element  Ai  is stored at location Li in memory then element Ai+1 will be stored at location Li+c where c is a constant. 

Linked organization :

 In this organization elements are stored in memory at any memory location Their sequence is maintained by linking the elements The physical location of the element does not determined its order in the set of element .                                                                                                

Example : Linked list uses the linked organization. 

0 comments:

Post a Comment