Data Structures
A data structure is a way of organizing data in computer so that it can be used in efficient way.
A data structure is a method used to process i.e; searching, sorting, storing etc large volumes of data.
Data structures are applied almost everywhere in many computer application.
They are widely in developing applications such as inter process communications, function calling, scheduling etc.
Types of data structures:
There are two types of data structures. They are as follows.
Linear data structure
Non linear data structure
The major differences between the above two (Linear data structure and Non linear data structure) is the arrangement of data.
Linear data structure:
In a linear data structure, the elements are arranged or organized in a linear order i.e; adjacent to each other.
In this type of data structure every data item is attached with its previous data item only.
If data / elements are stored in linear order then it will be easy to traverse the data as they are adjacent to each other.
we can traverse elements of linear data structure in single step only.
It is very easy to implement the linear data structures.
The examples of linear data structures are stack, queues, arrays, linked list etc.
Arrays are used to stores values of similar types we cant store values of dissimilar types in arrays.
Stack is a linear data structure which follows first in last out (FILO) or last in first out (LIFO).
Sueue is a linear data structure which follows first in first out (FIFO) or last in last out (LILO).
Linked list is a collection of nodes. These nodes are allocated dynamically based on our requirement.
Node consists of data and address.
Non Linear data structure:
In a non linear data structure, the elements are not arranged or organized in a linear order i.e; not adjacent to each other.
In this type of data structure every data item is attached with many other data items.
In a non linear data structure it is difficult to traverse the data as they are not adjacent to each other.
we cant traverse elements of non linear data structure in single step it requires several step.
It is very difficult to implement the non linear data structures compared to linear data structure.
Non linear data structure effectively utilizes memory in comparison to linear data structure.
The examples of non linear data structures are graphs and trees`.
Traversing is one of the operation on the data structure. It is the process of visiting or accessing each and every element present in a data structure.
The very basic operation that can be performed on any data structures is traversing.
some operations that can be performed on data strictures are traversing, sorting, searching, swapping, inserting, deleting etc.
Swapping- it is a process of interchanging the elements.
Sorting- it is a process of arranging the elements in ascending or descending order.
We are having so many techniques to perform sorting like bubble sort, insertion sort, selection sort,merge sort,quick sort etc.
Searching is a process of finding a particular element in a list. linear search or binary search can be used to perform searching.
Binary search is applicable only when then list is in sorted order.
A data structure is a way of organizing data in computer so that it can be used in efficient way.
A data structure is a method used to process i.e; searching, sorting, storing etc large volumes of data.
Data structures are applied almost everywhere in many computer application.
They are widely in developing applications such as inter process communications, function calling, scheduling etc.
Types of data structures:
There are two types of data structures. They are as follows.
Linear data structure
Non linear data structure
The major differences between the above two (Linear data structure and Non linear data structure) is the arrangement of data.
Linear data structure:
In a linear data structure, the elements are arranged or organized in a linear order i.e; adjacent to each other.
In this type of data structure every data item is attached with its previous data item only.
If data / elements are stored in linear order then it will be easy to traverse the data as they are adjacent to each other.
we can traverse elements of linear data structure in single step only.
It is very easy to implement the linear data structures.
The examples of linear data structures are stack, queues, arrays, linked list etc.
Arrays are used to stores values of similar types we cant store values of dissimilar types in arrays.
Stack is a linear data structure which follows first in last out (FILO) or last in first out (LIFO).
Sueue is a linear data structure which follows first in first out (FIFO) or last in last out (LILO).
Linked list is a collection of nodes. These nodes are allocated dynamically based on our requirement.
Node consists of data and address.
Non Linear data structure:
In a non linear data structure, the elements are not arranged or organized in a linear order i.e; not adjacent to each other.
In this type of data structure every data item is attached with many other data items.
In a non linear data structure it is difficult to traverse the data as they are not adjacent to each other.
we cant traverse elements of non linear data structure in single step it requires several step.
It is very difficult to implement the non linear data structures compared to linear data structure.
Non linear data structure effectively utilizes memory in comparison to linear data structure.
The examples of non linear data structures are graphs and trees`.
Traversing is one of the operation on the data structure. It is the process of visiting or accessing each and every element present in a data structure.
The very basic operation that can be performed on any data structures is traversing.
some operations that can be performed on data strictures are traversing, sorting, searching, swapping, inserting, deleting etc.
Swapping- it is a process of interchanging the elements.
Sorting- it is a process of arranging the elements in ascending or descending order.
We are having so many techniques to perform sorting like bubble sort, insertion sort, selection sort,merge sort,quick sort etc.
Searching is a process of finding a particular element in a list. linear search or binary search can be used to perform searching.
Binary search is applicable only when then list is in sorted order.
No comments:
Post a Comment