0% found this document useful (0 votes)
18 views

Introduction To Data Structure

Uploaded by

Palkar Nilo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Introduction To Data Structure

Uploaded by

Palkar Nilo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Data Structure using C

Jjait 1 .
to Dato StructureS
1. ntioduction
Concept
and need of DS Abshraçt Data Type
Type.s ot Data structures
i)Lineoar Data Structueg
gtructure S
i)Non- linear Data
3Algorithm Complezity
i ) Time
i ) 9pace Struc
S t r u ctu1eS
tuieS
on Data
Operationg
4
i)TraverSing
i )Searching
i) Insertion
i )Deletion
N) Sorting
Unit- 1
INTRODUCTION TO DATA STRUCTURES
Tntro duction to Data and Dota.
Data Object
Data iS_ col lection of intormation but
mothinnq but a callection of
and humberSalphabetS
Symbols combined to epTesent information
Information is 9ymbolic epresentation. It has
seme usetul meaning that helps in
us makinq g0ad
JdaementS.

2. Data object:-
Data obiect is a teim that eters to a set of
elements Sucha gefmay be finite or infinite.

Intioduction Concepr and neeo of Dg Abstract

Data Type
Definition of a t a gtiucture:
A data Structui is a graup o t data elements

that are put togetnerunderene name,and


wbich defines apartICular way ot t oring and
data in aCom puter 8o that it can be
argani 2inq
used efficiently.

Structuse-
Need of Data between the
a c l o s e _ C o n n e c t i o n _ b e

There is
-

9tructurinq
of olata and thesynthe
item.
sis af alaovithm-
data tupe or there ore num ber
For each
o f operationg.
Data 9howd be 1epregented in a way Fhat
makesefficient imple tmentati on of
operation:
If a lineay data is epresented using
lin ke d orqanization then modification
is es9 timeconsuminq where a9 accesSirn9
alarge ist becomes inefficient
In Seguential organization accessing is
efficient but madificati ons are costly
Abstract Dota Type
I n prg1amminqo gituation occurS when
built- in- data typeS 01 not enough to

hand le Complez data StTuctuye S


-1t is the pTOqTammer'S esponsibility to
Cieatethis 3pecial Kind of dlata type.
The pi0g1ammer heeds to detine eveiythinq
the data type such aS houo the
related to

data values ae Stored the possible 0perations


be, carried out With the cusS tom
that can
and
data type that it must behaveike abuilt-
pe
type
in ty and not ceate any conBusian wbile
coding the piogiam
olata types are called
Such custom
Abstract data type
and in Ctt Struct l elass
In C 8truct to e1eate obstyant
used
Keuwor ds aie
dad a ype.
*TypeS of Data 9truc tureS:-
Data 9tructures have been elassifie d_ as
follau S:

Data StructureS

Non- primlHve Derta


Str.
Primitive Data 9tructuree

int
Ligts
char Arrays
Fioat
baolean Non-linear
Lineat DS
OS
Single
aimenSi on al 1.9tack LTree9
two 2. Queue 2. &raph.s
gimensionat

Multi
dimenSional <-

StructureS
aTe that diuectly
narmallyare dire
Data
operated
upon bs machine -leve instructian.
prim1tiye data 9tructures
9tructures.
axe known as

- a t a Structures are classtied basically inta


2 t9pes-
Pyimitive ata 9tuctures
Non-pTI mitiveDat 3tructuyes
1. Primitive Data Structures-
o1 the
-Primitive data Structures
fundamental data types cohich are supported

by a programminq lanquagesS.
Theseare integerS, 1eal, chara ters
boolean.

Data Structures:-
22 Non- primitive
Oata 9truct ureSare
those
Non- pvimitive
which aieCreoted by
d a t a gtructu1 eS
primitive data Structure s.
using data gtructures are
-Non-OYimitive
as ofinear data StruCtures
classitied
Non-tinear data Structures
and b) the
be classilied as inthe
A l s o i t mugt
tree diaqram
data StructureS:
Linear
a) Structures, the elements
elementS
linear data
In inear fashion.
in
are
arranged
elements of a data structure
1f the
linear Or Sequential
Stored in a
Qre
alinear oata stucture.
order,then t iS
of linear data StructuY@
eramples
-The

ae ) Arrays
ii) Linked tist
ii) Stackg
i) Gueues
i) AYrayS
- An aYTay is a Collection at similar datta
-

array
elementS
-The Se data elements have the Same
d ata tu pe.
The elementS of the a a y a1e Stored
in eOnse Cutive meno1. locations.

A 10 20 30

ALoJACi AL2] ABAFOiAvray


is havinq Size 5 and
AYray AA
indez is
aloayS Storted fram AI01.

ii) Jin ked List i


in a inked list each no.de isallocated
space as it is addedto the list.
-1t is having t o fields of each no de
In each ho de first field points value
of the element and second ield addresg of-
the location

3
fig Linked 1iSt
iii) 9tcckg:
A A Stack is a linear data gtructure in uhich
insertion and deletion of element.sare dane
anly_one end, hich iS Knon as the_
top of the stack. [ TOS1
Sta ck is called a Last In- First Out
LIfo) 9tYucture be.cause thelast
element which is added to the Siack
iS thetirst element hich is ooleted
rom the Stack

AC E
A31
ACXC
AT11 8
ALol A
fiq Stack

iv ueue
A 9ueue is a tiYSt-in , tivstQut data
structuYe ( IFO) im which the element
that is inserted first isfirst one to
be taken out.
-The elementS in a queue are added at
one end called the1ear end and removed
fTom the 0ther end galled he Pront end.
front end Rear end

o 20 30 40

Fiq. Queue
6) Non- Linear Data Structuie:
-Tthe elements of a data Structure are
not Stored in a 9equential order then it is
a non- linea_data gtyuctureS
The exam pleS are tree and graph
araph
1) TYee:
A tree is anon- linear dat a Structure
which eonsis ts of a collectionof node
in a hi erar chical manner
arYanged
The Sim pleSt form of a treeiS a
the
binayytree
-A binary tree consi9 tS of a root node
and left
and 1eft and ight Sub-treeSwhere both
Sub-tree9 are als o binorytrees
R

Ta

fig. Tree
i i Graph -
- A graph is a nan- linear data St ructuve
hich isa collection of vertices
Calso Called nades) and edaes that connect
these yertices
Ag1aph iS f ten viewe d aS a qeneraliza
tion of the tvee gtructure, here instead
ot a purely parent-to- child relations hip
bet ueen the tree nodes.

ig raph
Data 9tvuctures

Pimitive Data 3tTucture Non-primiti ve Data str,

char
flo at Bool ean
nt

Linear Oota stra Non-lineav


dota Styu.

ATYO Linked Stack Gueue Tree Graph


List
Fig. Clasgti cati on of dota Strueture

You might also like