WHY Data structures ?

Data structures are the repository of data in primary memory. Programs are set of instructions written for processing data and where would one keep data so that the instruction could access them for processing purpose? It is data structures like Array, linked list or may be a tree which serves the purpose of storing data in primary memory so that the instruction could fetch and process them in a convenient way.

While learning the basics of C we had understanding of only one basic data structure and that is Array. As a data structure, Array, on one hand, has got some facilities on other hand it has some pit-falls. Array is contiguous, that’s why it is random and that is one of its facilities but this contiguous allocation becomes a problem when we suppose to process huge amount of data, in such cases the allocation of array in run-time might turn into a failure, further more, insertion, update, deletion of elements in an array becomes time consuming affair as we need to reallocate the whole array after such operations in run-time.Array is fixed, we need to mention the size  of the array during the allocation period, inserting an element afterward really becomes a time consuming affair. So the demand of writing efficient program needs better data structure than array and that is linked list. How to create, update, delete, search in a linked list that we learn in Data Structure. Further hierarchical representation of information enhance searching capabilities of code, How we coould represent data in hierarchical order, for that there is tree. There are various types of trees, Binary search Tree, B-Tree, B+ Tree, Game Tree, Threaded Binary Tree, AVL Tree  ,each having there own utility. We learn how to deal with all those data structures under this syllabus.
A program always needs to be an efficient program. The efficiency of any program is judged on the basis of two yard sticks – 1) the execution time of a program, 2) The resource (Memory) that it aquires for execution. Both execution time and Memory depends on the number of input that the program process, Increse the number of input, the possibility is that it is going to take more execution time and more memory. We need to try to keep execution time and memory as much as possible independent of the number of input, such that, the variation of input has little impact on execution time or the resources that it aquires, but not all the time one programmer can achieve that, with the demand of the logic it would not be possible to write a program whose execution time or memory dependance would be totally independent of input volume. Normally it happens that when we try to stabilize the execution time we need to sacrifice memory and when we try to stabilize memory we would require to sacrifice execution time, it is often said as TIME-SPACE trade off. In data structure we learn how to compare two algorithm on the basis of execution time and resource requirement where both as a function of the input data volume.

Now-a-days all the modern languages (JAVA / DOT NET/ C++) comes with rich library that has all the data structures inbuild within it.  As a programmer we would seldom require to build the operations on a data structure from the scratch. But the need of efficient state-of-art program the use of proper data structure is obvious, thus, understanding the data structures with all its functionality, to be a good programmer, is obvious without any doubt.

1.Primitive data structures
 These are the basic data structures and are directly operated upon by the machine instructions, which is in a primitive level. They are integers, floating point numbers, characters, string constants, pointers etc.
2. Non-primitive data structures

It is a more sophisticated data structure emphasizing on structuring of a group of homogeneous (same type) or heterogeneous(different type) data items. Array, list, files, linked list, trees and graphs fall in this category


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s