Data Structures
Data Structureis a way of collecting and organising data in such a
way that we can perform operations on these data in an effective
way.
Data structure is formerly defined to be a triplet (D,F,A)
Where,
D -> set of data objects
F ->is a set of functions
A->Axioms(set of rules to implement functions)
Example: integer data type
D =(0,+-(1),+-(2)...)
F=(+,-,*,/,%)
A=set of binary arithmetic's rules to perform
addition,subtraction,division,multiplication and module operations.
Visit for more Learning Resources
2.
Need for DataStructure
1. Data structures are important way of
organizing data in a computer
2. It has a different way of storing and
organizing data so that it can be used
efficiently.
3. It helps us to understand relationship of one
data element with other
4. It helps to store a data in logical order.
5. It stores a data that may grow and shrink
dynamically over a time and allows efficient
access.
3.
Abstract data type
Abstractdata type is defined in term of its data items
or its associated operations rather than by its
implementation.
It is just mathematical model which specifies “logical
properties” and “operations” of the data type.
It simply tells us “what “ has to be done.It doesn't tell
“how” do do it.
Advantages:
– Abstraction
– Encapsulation
– Generalization
PRIMITIVE DATASTRUCTURE
The primitivedata structures are the basic data
types that are available in most of the
programming languages.
The primitive data structures are used to represent
single values.
Example:
Integer, character, string, Boolean
7.
NON-PRIMITIVE DATASTRUCTURE
The datastructure that are derived from primary
data structure is known as non-Primitive data
structure.
These data types are used to store group of
values.
Example:
Arrays, Structure, Union, linked list, Stacks, Queue
etc.
8.
LINEAR DATA STRUCTURES:
Inlinear data structure the elements are stored in sequential order.
The linear data structures are
Array: Array is a collection of data of same data type stored in
consecutive memory location and is referred by common name
Linked list: Linked list is a collection of data of same data type but
the data items need not be stored in consecutive memory locations.
Stack: A stack is a Last-In-First-Out linear data structure in which
insertion and deletion takes place at only one end called the top of the
stack.
Queue: A Queue is a First in First-Out Linear data structure in which
insertions takes place one end called the rear and the deletions takes
place at one end called the Front.
9.
NON-LINEAR DATA STRUCTURE:
Elementsare stored based on the hierarchical
relationship among the data. The following are some of
the Non-Linear data structure
Trees:
• Trees are used to represent data that has some
hierarchical relationship among the data
elements.
Graph:
• Graph is used to represent data that has
relationship between pair of elements not
necessarily hierarchical in nature. For example
electrical and communication networks, airline
routes, flow chart, graphs for planning projects.
10.
Operation on datastructure.
Insertion: Adding new element in the data structure
Deletion: It is removing data from data structure
Searching: It is finding location of a data in within a
given data structure.
Sorting: It is arranging of data in some logical
order.
Traversing: A data structure is accessing each data
only once.
Merging: It is combining of two similar data
structures.
For more detail contact us