0 ratings0% found this document useful (0 votes) 483 views8 pagesDsa Handwriting Notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
e [ Whar is Data Steucture 7]
Data can be arvanged ina many ways, logical
oY Mathematical arrangement OF a data is
Called Data Structure.
Examples:- Asvay , linkedlist, stack , Queue, Tree,
Graph, and many more -
°
SD Sequence of steps performed _on -the data using
efficient data structures 10 Solve a aiven _
problem -
Example t Soxting an Array.
Classification of Date StructureeI
a): | Pyimitlve and Non - Primite Data Structure.
b)- | Static and Dynamic Data Structure:
Q: Pexsistmt and ephmeral Data Structure.
Non- Primitive Further Pessistent Fusth ev
Kiivided into tuo ty ees divided into thee
fl. [Linear Data Styucture _. | Pastially Pessistent
2) ied Dara Structure gj]. | Fully Persistent
3).[ConFluenty Persistent
pes
The Following, Four Operations Piey a major yole -
1). Traversing : Accessing each yecord exactly once
So that cextain items in the vecoyd May be processed:
Searching: Finding -the location of the xyecord with
a aiven key value -
Inserting +. Adding a new yecord 40 the stvuctuye
Deleting: Removing a record from the stvuctuye .
Mer9 ing Combining the vecords in two different
Sorted Files intoa Single soxted Files:
6). Soxting: Ayranging the yecord In same logical
order. Example :- Alphabetically accovding to _
Some NAME key ox in Numerical oder according
|ro_ Some NUMBER key.5 A Search algoyithms is a Step-by- Step procedure
Using to locate specific data among collection
of data.
OF Seaych algoxithms alth the Complexi
I)-_|Lineay Search? A lineay search or sequential
Search is @ method for Finding an element wlthin
@ \ist- It is Ser, checks each element oF
the list until @ match is found oy the whole
list has been seayched-
C(n)=n/2_]¢@——— Complexity of lIneax Seaych -
2): Binary Seavch : Th Binary seaych appyoach the
element is always searched in the middle oF a
portion of an array. Binayy seaxch can be
implemented only on a_1). _Cne Dimentlonal Avtay: The axvay with only
Subscript that array is called as One Dimentional
Axtay- i =
Example in
aaa aw Subscriet .
Two Dimentional Away: We axvay with two
Subscript that axvay is called a$ Two Dimentional
PLETOY,- “4
Example ix
2). _Multi-Dimentional Avvay: The qrray with move
than two subscript that axvay is called as
Multi - Dimentional Ayray.
Linked List is & ineay Data styuctuse. It is also
Collection ef more than ene data items of a
disimilay data type like ayyay but it_can not
stored tt in Contigues memory locaton .
Sure[tr can be stoved yandomly in a main memory.
co that linked 11st contains 4wo part one Cor
[Dara and second part fox the Address of the
next data element:
cacy STF sss
element
Tyres OF linked list
Singiylinked List + 4.
[star | SOR] : > 8 [Nutt_
200 300
Doubly ttnked |ist:
[afin 2a) eects! feo [3 [Nutt |
100
_ e200
Ciyculay \inked list:
[2 [2007 L3 [300] Eu roo}
100 200 00
Doubly Clyculay linked list:
Leela [200 [34 E [Seo] 1 |
a <3ae, >
e Stacks
SPA stack Is a list OF elements In vuthich
an elements may be Inserted or deleted
only at one end called the Top of the
SHOCK
Stack of dishes
Push —> Thsext elements Into stack
Delete elements From stack. <— Pap-
au.
| Coueues |
A Queue 1s @ linear list of elements iN which
deletions can tale place only end Called Front -
and insertions can take place enly at the
omer end called the year.Lalvees))
Tyees ave non- linear data Styucture where
data axe Stored or data Conteining a
hfevarchical yelatlonship b/w elements -
A binary tree + 1s defined asa Finite
set of elements called nodes -
“Traversing Binary tree
There are thsee Ways oF traversing a binasy tyee
T with yoot R.
Preordex Tnosdes
Process the root] © Tyaverse left Je Traverse the
R- Substvee. left substree .
Tiaverse ler © Process the © Tyaverse Right
subtree OF R Inf xoot R Substvee.
preorder -
THovexse +ne * Traverse Right |* Process the
Right subtree Substyee - yoot R-
10 pteorder.| SEA
SP | Graph 1s a collection of two [Link] E
|wiheye,
V — Vertiles / Node
& =? edges
Gyaph ts a mathematical structuyes that
yepresent poiy- wise velationship between objets
where nodes ave connected with edges.
— Vewrex is nothing but the data
element which is also Known as
Nodes-
[Edge] — Edge ts a connection link between
4+wio verstiles-
[A | [8]
[oe
Representation of the 3yaph.
A)-, Adjacency Matsix
B)-| Adjacency \ist-