Submitted by moazkhan on Saturday, August 9, 2014 - 16:19.

Introduction to Data Structures using C++

Objectives:
In this tutorial, I will
1. Briefly explain the meaning of data structures.
2. Explain the importance of data structures.
3. List different data structures.
4. Tips on selecting the type of data structure to use for a particular application.
What does the word Data Structures mean?
A Data Structure is a way of organizing or grouping the data available to you so that it can be used later in a convenient way using the minimum resources of computer (e.g. memory ) and user (e.g. time ). Thus, a Data Structure is simply a way to organize data. As an analogy, if your house is complete memory, a book shelf is like a data structure. You put your books on a shelf so that it would be convenient for you to find them when you want to use it and it saves your time too.
What is the importance of Data Structures?
Imagine yourself choosing a multiplayer online videogame, both have same graphics but one game lags and other one runs smoothly. Which video game would you like to play? Of course, the one which runs smoothly. Hence, speed matters.
The memory is also really expensive. Imagine yourself designing software for one of the biggest bank of your country. You would consider memory taken per account holder to cater millions of account holders. Hence, memory management also matters.
Thus, speed, memory usage, data deletion, ability to rewrite data and many other factors must also be kept in mind if you want to make an admirable program.
In data structures, our main aim is to arrange data in a way that according to needs, above problems are minimized and hence, whatever application, software or game you are designing is most efficient. (Proper definition of efficiency and its mathematics will be provided in a later tutorial)
List of Data Structures:
There are many data structures available to the programmers and it is their responsibility to choose a data structure for their code. Following are some of the main data structures.
1. Arrays
2. Matrix
3. Lists
4. Stacks
5. Queues
6. Priority queue
7. Trees
8. Graphs
In addition to these, there are several other data structures and the above mentioned data structures have further types but we will restrict ourselves to the most important data structures .
Tips on selecting a Data Structure:
Unfortunately, there is no “BEST” data structure. While writing a code, you must first analyze and choose the data structure which suits you the best. But following are some tips for selection of a data structure
1. Analyze your problem and determine the resource constraints.
2. Make the list of operations that are being performed on data.
3. Select the data structure that meets these requirements.
Note: In next tutorials, one by one each data structure will be explained along with its C++ implementation so that the reader not only grasps the theoretical concepts but also finds it easy to use these data structures.