Introduction to Data Structure - BunksAllowed

BunksAllowed is an effort to facilitate Self Learning process through the provision of quality tutorials.

Random Posts

Introduction to Data Structure

Share This

To cut it short, in simpler terms, Data Structure is the field of study to efficiently store data in the primary memory so that we can fetch it quickly and systematically.


Organizing the data in a structured way is not the primary purpose of data structure. Data Structure provides efficient operation on structured data.


Hence, we can officially consider data structure as a mathematical or logical model of an organization of data which helps us to understand the relationship of one data element with the other and to organize those within the primary memory.


Before we get deeper into the subject of Data Structure, let us understand, three types of Data namely

(A) Primitive Data Type, 

(B) Derived Data Type, and 

(C) Abstract Data Type.



Primitive Data Types


Primitive data types have specified and predefined ways of storing the value of the data by the operating system. Consequently, the set of operations that can be done upon these data is also predefined.


A programming language uses these data types as the very basic way of storage. For example, in the C programming language, int, float, etc are considered to be primitive data types, because the operating system already knows how to store an int or a float. The predefined operations for these two types of operations are addition, subtraction, etc.


Beyond the limit of the primitive data types, in many cases, we experience certain situations where primitive data types are just not enough with respect to performance issues. This leads to two more data types as described below.



Derived Data Types


Derived Data Types focus mainly on the effective usage of primitive data types. 


This type of data gets derived from different organizational principles and these also have specified implementation within the operating system. 


For example, an array is a derived data type for organizing homogeneous data for sequential access; whereas a structure is a derived data type for organizing heterogeneous data.



Abstract Data Types


Even if we consider primitive and derived data types as basic building blocks of organizing our data into the primary memory, still they can be regarded as sufficient to handle the complex data access requirements arising out of sophisticated applications.


In this context, an abstract data type is nothing but a conceptual model of data organization that can be built using different combinations of primitive and derived data types. Though this data organization has no real-world existence, still they can be physically achieved through prudent usage of the primitive and derived data types.


For example, Stack is an Abstract Data Type. Though we have seen stacks of books or stacks of bottle crates physically, inside the primary memory of the computer machine, at the bit level, there is nothing called Stack as such. As the machine can understand the primitive data type only, so there must be some ways to implement the Abstract Data Type Stack through the primitive and derived data types available. Data Structure, as a subject, helps us to gain the knowledge to do the same.


An ADT consists of two things:

The interface section: This combination of code and documentation describes how the ADT can be used. To use ADTs, a programmer goes through the relevant portions of the interface section and performs the necessary modifications to include the ADT in his code.
The implementation section: This is documented code that implements the data type. It need not be seen by a programmer who is just using the ADT; it can (theoretically) be written once and then used many times by different programmers in different situations.


We will learn the different types of Abstract Data Type in the rest of the tutorial along with different operations which make them so powerful to describe the real-world problem.


Happy Exploring!

No comments:

Post a Comment