Introduction


Definition
Data Structures are the concepts and techniques used to store, modify and retrieve related data items in an organized way so as to meet the needs of a program ex: to increase the efficiency, for better understandability etc.

One of the most influential books named 'Data Structures + Algorithms = Programs' correctly portrays the importance of Data Structures in Computer Science.

Real Life Example
For understanding data structures in a simple and better way, consider the following real life example.

Brooke Burke, the sports teacher likes to take her 100 students for a trek during holidays. For that, she has to provide a lot of guidelines and information about the ongoing camp. Also, she may have to give separate instructions to each and everyone. How can Miss. Burke organize the students such that she could reach any student from any other student in as short time as possible.

Prerequisites: All 100 students are given numbers from 1 to 100. The distance between two nearest students is 1 meter.
Assignments: Find out the approximate distance and time taken for Miss. Burke to travel between two farthest students in each of the following organizations.

Case I)
All the 100 students stand in a straight line. Miss. Burke is represented as a white filled circle.
Here for Miss. Burke to move from 1st student to 100th, it takes a lot of time as she has to travel 99 meters.

Case II)
All the 100 students stand in a circle sufficient to fit 100.
Here Miss. Burke has to move from 1st to 51st student. The arrangement of students can be considered as a regular polygon with n = 100 sides. We have to find the length of the largest diagonal i.e diagonal between student 1 and student 51.

For a regular polygon of n sides and l sidelength, the largest diagonal d is given by:

Substituting n = 100, l = 1 meter, we get d = 31.8362 meters. It takes less time than the previous case but we cannot stop at this point. We have to search for alternate solutions.

Case III)
All the 100 students stand in a matrix of dimensions 10-by-10.
Here for Miss. Burke to move from 1st student to 100th student is like passing through a diagonal of a square. The distance to be covered in this case is equal to 14.1421 meters.

Case IV)
First 25 students stand in a circle sufficent to fit 25. Behind each of the 25 students, three students will be standing not maintaining a distance of 1 meter between each.
Here Miss. Burke has to move from 1st student to 13th/14th student. Using the formula for the longest diagonal in a polygon with odd number of sides, we get d = 7.963 meters. Here the distance b/w adjacent students in the circle is 1m. The distance b/w adjacent students behind the one present in the circle is not 1 meter and the distance is not required also. Also this organization has an advantage over the previous one in that Miss. Burke can stand in the center of the circle and announce anything which is heard by all. That may not be true in the previous case.

Implications to Computer Science:
-> The organization of data in a program/algorithm is similar to the organization of students described above. When we think of different methods of storing/organizing data, the efficiency of its access increases and the understandability becomes better.
-> The efficiency class of a program does not depend only on algorithms but also on data structures. If better data structures are used, the program will have a better efficiency class.
-> The data structures are chosen not with the sole aim of efficiency but also factors like re-usability, generality, flexibility, simplicity etc...

Editors
For editing source codes, use good editors like:
Notepad++ - a free source code editor for Windows
EditPlus - editor of editors for Windows
gedit - an excellent free source editor for Windows, Linux, Mac etc.