DATA STRUCTURE-Array, Linked List, Stack, Queue, Tree, Graph.
Data structure
There are various popular data structure are used to maintain data. The definition of data structure is quite similar to its name.
“Data structure is the way of data organization on the basis of logical or mathematical model. ” Popularly there are six data structures are used for the collection and organization of data. Some data structures mainly coated as linked list, tree, array, queue, stack and graph.
There are two main considerations are available regarding data structure.
1) The data structure must have enough capacity/rich to handle all the data.
2) This data must be easy to understand simple in organization and can be quickly processed.
1. Array –
It is one of the simplest type of data structure. Array is widely known as one dimensional array as well as linear array. Data structure specially by using a linear array we can create a list of finite number of similar data elements.
Visually 1,2,3,4,…………,n. In array for representation purpose there are three kinds of notation can be used.
i. Subscript notation
A1,A2,A3,……………….An.
ii. Parenthesis notation
A(1),A(2),A(3),…………….A(n).
iii. Bracket notation
A[1],A[2],A[3],…………….A[n].
There
is an example of student data structure in array format.
Student |
Sonu |
Monu |
Ranu |
Ganu |
2. Linked list –
This is advanced data structure as compaired to array. It depends on the increase or growness of data that which data structure is suitable to represent respective data elements.
Here in linked list more than one lists can be connected i.e, linked to each other. Two list may contain different types of data and for the proper representation of relationship between data we have to use linked list.
For the linking purpose we have to use link which is properly called as pointer (ptr). Pointer is used to connect data elements of two different lists.
Pointer takes or occupies very small space that’s why it takes small period of time for working. In the below example we will see how linked list works.
Names |
Company |
Ram |
1 |
Sham |
2 |
Suresh |
1 |
Naresh |
3 |
Sandip |
3 |
Mandip |
1 |
1 BMW
2 MERE
3 HERO
Fig:Linked list
3. Tree – (Rooted tree)
This is more advanced data structure as compaired to array and linked list. Large number of data can be properly collected, processed with the help of tree data structure. Array and lined list are linear type of data structure, where as tree is non-linear type of data structure.
Tree expands in both way i.e, left and right side. There is no limit but there must be finite number of data elements in the tree data structure. There are parental nodes and children nodes in the tree data structure. Children nodes are also called as successer. As per the functionality of tree data structure we can describe it using the below diagram.
Fig: Tree
4. Stack –
Stack is one more intresting type of data structure. Stack is like container. When we start inserting data elements in stack this process is known as push function. In the same way removing data elements from stack is known as pop function.
When we insert any data element in the stack that element goes to the lowest level of the stack. But at the time of deletion we cannot remove the first element because stack is one ended data structure. So this technique is known as LIFO. LIFO stands for Last In First Out.
From the below diagram stack data structure and its functionality is properly explained.
Fig: Stack
5. Queue -
This is another form of data structure. Queue is like pipe which is opened from both the ends. Queue is also called as line sequence data structure. The element which is inserted initially in the queue data structure can be processed initially and removed in the same way in the same sequence.
This queue structure follows FIFO. FIFO stands for First In First Out. The element which is added first can be removed first. From the below structure we will try to understand the basic functionality of queue data structure.
Fig: Queue
6. Graph –
Graph is another kind of data structure which is used to explain data flow. As explained earlier data structure is just a logical or mathematical model of data organization. In graph data structure there are end points or we can say nodes are used to show the flow of data. From the below figure we can understand the basic structure of data based on graph.
Fig: Graph
Comments
Post a Comment