Introduction to Data Structures
Introduction to Data Structures
What
is Data Structure?
Whenever
we want to work with large amount of data, then organizing that data is very
important. If that data is not organized effectively, it is very difficult to
perform any task on that data. If it is organized effectively then any
operation can be performed easily on that data.
Data
Structure is a way of collecting and organizing data in such a way that we can
perform operations on these data in an effective way. Data Structures is about
rendering data elements in terms of some relationship, for better organization
and storage. For example, we have data player's name "Virat" and age
26. Here "Virat" is of String data type and 26 is of integer data
type.
We
can organize this data as a record like Player record. Now we can collect and
store player's records in a file or database as a data structure. For example:
"Dhoni" 30, "Gambhir" 31, "Sehwag" 33
In
simple language, Data Structures are structures programmed to store ordered
data, so that various operations can be performed on it easily. It represents
the knowledge of data to be organized in memory. It should be designed and
implemented in such a way that it reduces the complexity and increases the efficiency.
A
data structure can be defined as follows...
Data
structure is a method of organizing large amount of data more efficiently so
that any operation on that data becomes easy.
NOTE:
- Every data structure is used to organize the large amount of data
- Every data structure follows a particular principle
- The operations in a data structure should not violate the basic principle of that data structure.
Based
on the organizing method of a data structure, data structures are divided into
two types.
- Linear Data
Structures
- Non -
Linear Data Structures
Linear
Data Structures
If
a data structure is organizing the data in sequential order, then
that data structure is called as Linear Data Structure.
Example
- Arrays
- List
(Linked List)
- Stack
- Queue
Non
- Linear Data Structures
If
a data structure is organizing the data in random order, then that
data structure is called as Non-Linear Data Structure.
Example
- Tree
- Graph
The data structures can
also be classified on the basis of the following characteristics:
Characterstic
|
Description
|
Linear
|
In Linear data
structures, the data items are arranged in a linear sequence. Example: Array
|
Non-Linear
|
In Non-Linear data
structures, the data items are not in sequence. Example: Tree, Graph
|
Homogeneous
|
In homogeneous data
structures, all the elements are of same type. Example: Array
|
Non-Homogeneous
|
In Non-Homogeneous
data structure, the elements may or may not be of the same type.
Example: Structures
|
Static
|
Static data structures
are those whose sizes and structures associated memory locations are fixed,
at compile time. Example: Array
|
Dynamic
|
Dynamic structures are
those which expand or shrink depending upon the program need and its
execution. Also, their associated memory locations changes. Example: Linked
List created using pointers
|
Comments
Post a Comment