Introduction to Data Structures and Algorithms

Data Structure is a way of collecting and organising 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. 
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.
Data structure is a method of organizing large amount of data more efficiently so that any operation on that data becomes easy

Basic types of Data Structures

As we have discussed above, anything that can store data can be called as a data structure, hence Integer, Float, Boolean, Char etc, all are data structures. They are known as Primitive Data Structures.
Then we also have some complex Data Structures, which are used to store large and connected data. Some example of Abstract Data Structure are :
All these data structures allow us to perform different operations on data. We select these data structures based on which type of operation is required. We will look into these data structures in more details in our later lessons.
The data structures can also be classified on the basis of the following characteristics:
LinearIn Linear data structures,the data items are arranged in a linear sequence. Example: Array
Non-LinearIn Non-Linear data structures,the data items are not in sequence. Example: TreeGraph
HomogeneousIn homogeneous data structures,all the elements are of same type. Example: Array
Non-HomogeneousIn Non-Homogeneous data structure, the elements may or may not be of the same type. Example: Structures
StaticStatic data structures are those whose sizes and structures associated memory locations are fixed, at compile time. Example: Array
DynamicDynamic structures are those which expands or shrinks depending upon the program need and its execution. Also, their associated memory locations changes. Example: Linked List created using pointers

Based on the organizing method of a data structure, data structures are divided into two types.
  1. Linear Data Structures
  2. Non - Linear Data Structures
If a data structure is organizing the data in sequential order, then that data structure is called as Linear Data Structure.
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.

Linear Data Structure

No comments: