data structure
data structure
Introduction to Data:
Data: Data is the basic entity or fact that is used in calculation or manipulation
process.
Data is value or set of values which does not give any meaning. It is generally a
raw fact.
For example,
1. 34 2. 13/05/2008
3.12,34,43,21
DATA TYPE : A data type is a term which refers to the kind of data that may
appear in computation. Every programming language has its own set of built-in
data types.
Example: Data
Data Datatype
34 Numeric
21,1,3 Array of integers
12/05/2000 Date
In C, the following are the basic data types are: int, long, char, float, double,
void etc.
Definition of Data structure:
“The data structure is the logical or mathematical model of particular
organization of data.”.
Data Structure = Organized data + Allowed Operations
1
OBJECTIVES OF DATA STRUCTURE
To identify and create useful mathematical entities and operations to
determine what classes of problems can be solved by using these entities
and operations.
To determine the representation of these abstract entities and to
implement the abstract operations on these concrete representation.
2
CLASSIFICATION OF DATA STRUCTURE
Based on how the data items are operated, it will classify into two broad
categories.
1. Linear data structure
2. Non linear data structure
3
2.Linked list: A linked list is a linear data structure that consists of a
series of nodes connected by pointers. Each node contains data and
a reference to the next node in the list. Unlike arrays, linked lists allow for
efficient insertion or removal of elements from any position in the list, as
the nodes are not stored contiguously in memory.
4
4. Queue: A Queue is a Linear Data Structure is a fundamental concept
in computer science used for storing and managing data in a specific order. It
follows the principle of “First in, First out” (FIFO), where the first element
added to the queue is the first one to be removed.
5
2. Graph: Graphs are those types of non-linear data structures which
consist of a definite quantity of vertices and edges. The vertices or the
nodes are involved in storing data and the edges show the vertices
relationship.
There are different types of operations that can be performed for the
manipulation of data in every data structure. Some operations are explained
and illustrated below:
1. Traversing: Traversing a Data Structure means to visit the element
stored in it. It visits data in a systematic manner. This can be done with
any type of Data structure.
2. Insertion: It is the operation which we apply on all the data-structures.
Insertion means to add an element in the given data structure. The
operation of insertion is successful when the required element is added to
the required data-structure.
It is unsuccessful in some cases when the size of the data structure is full
and when there is no space in the data-structure to add any additional
element.
3. Deletion: It is the operation which we apply on all the data-structures.
Deletion means to delete an element in the given data structure. The
operation of deletion is successful when the required element is deleted
from the data structure.
4. Searching : Searching means to find a particular element in the given
data-structure. It is considered as successful when the required element
is found