FDS Unit 1&2 Insem Notes
FDS Unit 1&2 Insem Notes
DK elAsSMAte
Date
Abshact DataTipes mn
Hbstxact data heeis
Hunction name o Callection ot fypa
tunctianand behaviou of t .
Specitication af ADT indicate what
AoT Opeaations
do
Detinitions ohodnd
Data T 1efers to mw datal unpocossed data-
aata may be
Ea-zeesgkaphs
SPPUDafeSE COMP
Page
Eq- Axxausin C
Eg-Linked List
Characteiistics
= Each algoithm S Supplied urth zexo or more inputs
Each alaoaithm must puoduced atleast 1 output
Each alaaithmshould haedetiniteness etectiveness
etc
t Paeudocode
Howchaats
Flouchoxts_
gaphicalsepresentation ofalgonthmns
They Can sho eroas in loqic andset ot data
easils he tested usinq can
tlawchaats
Redd N
Remaindex =Oo
Sum = 0
Repeat hn h
Remaindex=Neel0 ainniunoz
Sum= Sum+ Remaindex
N=NLiO
Until N<0
Display Sum
End ln
0itbollos
bako
bonDin
SPPU SE COMP
Space Camplexity
Spacecomplexity is defined as amaunt of mom.
sequired by an alaoaithm to gun.
i s denated bs 0(n)
Time Complexits
Biq OH Notation
I t is denated by 'o
t Samethod
ofsepresenting
algaaithm's sunninqtime upper bound of
Omega Notatian
bobai
Ttls_dencted bs
i s used to epresentlowex bound of algorithm's
sunNiNg time
Pend
SPPU SE COMP
alsSMate
Date
Page
Theta Natation
It isdenated by e
is Used to xepresent bath uppexbound and
laex baund of aunninqtme
lome a n d p
TTE
f subpaoblems ase lakge enough, then divide aand
nd
Conquex is eapplied
Eg Consider olements10 20 20
410 50, o
020
Divide
30 401o 50 GO
Divide
70 20 30 40 1050 GO
Divrde Divide
70 2o DivideR
30 4o0bhe 50 GO
Divide Divnde Divide
7O 20
80 40 10 50 Go
hen Mlerge
221
- 0Yhh A o2n9
Greedy Sthatequ
. This methodis papular torObtaining aphimiged Salutions
Eg Dikstha's Algoxithm
SPPU SE COMP
UNIT-I
Repkesentation Addxess Calculation
*Memazs
piviG
4 Foamula
Rowmajox
CORKE
Element a[zl[41 willbeat addaess=
1020 3x5t4x 2 (OR) 1020(2x+3)
1620t 38 1020t 26
058
I046
(3x
SPPU SE COMP
Page
Calumn Majar da
ORKE Eltmentnki[41uill be _placedat address
1020+ (4x4t 3)x2(OR 1020t2xat2)x2
ld 20+38 L020t (28)
1058
Oxdexed List
Repzestntation
-19 E 3115t
10 Coefficitnt 10a-19
Of polyn omia)
5
3
as exponen of
aeSp, COPEEieient
epxesenhnqa Singlevazigblepalyngmial,
ane
Fox
Can make use af One dimensional axtay-
l o b
Toomol
SPPU SE COMP
Page
Palunomial Addition
HSSumethatpalynamials
toqet zesulkant
A and Bae to be added
palynamial C_
CaseTT: TE exponents of bath tems
af palunamioa
H3B axe equalthen caetticients are added,
and nus temis stoxed in C and adrance
painteas,jkto next tem
Case IT It expanentot term indicated bs i'in A.
s esS han expanenth.al tem in B, then Cops
Cuent term_af Bpainted bs to lacatian painted
byRinpalynamial C
Case IL TH expaneaf tumindicatedby in B
is less than expanent aE teim in A then Cops
Curent teum_af A pointed b to location
pointed bs k in palynamialLc'
Palynomial Multiplicatian
A
SPPU SE COMP
Spakse matix
Tn mans situati.ons is Yeaslaano
mataia Sigeis eaylaaqe
but most ot elements axezex0snat necessa
aluaya 0 Sarilu
Onlu a smallractionok matai is actualls uSed
A matixat Such hpeis called spase_mat
actuallu1Sed
20 Aaray is used to epresemt aSparse_matin
in hich thexe arethxee xows named as
Rou Indexuhexenon zero element is located
i Calumn Tndex where nonzera element is located
Yalue Nalue otnonzero element lacated a indey
Eg00 zo 4
0 5 570
2 0 O
Rau 1
Calumn 242312
Value 3 572 G
SPPU SE COMP
Eg
Let A E G 5 uod
1 2 7
2
2 4
365
5 4
8
BT 5
2 1 1
4 2 2
3 5
5 4
G
matnaisispeitamed usinq
Sparse
Simple tianSpose Of Complexity is d(n)
Hence time
2 nested tor loops canrentianal matrix tianspose
f o r
Syntax
Isize]
data type name_of_array
For example, int a [10]; double bl[10] [10];
the square bracket size of the array is given.
Here 'a' is the n a m e of the array inside
are of integer type in array
'a'.
This array is of integer type i.e. all the elements
of data structure
Advantages of sequential organization
1. Elements be retrieved or stored very
can efficiently in sequential organization with
the help of index or memory location.
locations. Hence searching of
2. All the elements are stored at continuous memory
element from sequential organization is easy.
structure
Disadvantages of sequential organization of data
sequential nature.
1. Insertion and deletion of elements becomes complicated due to
2. For storing the data large continuous free block of memory is required.
3. Memory fragmentation occurs if we remove the elements randomly.
AbstractDataType Array
Operations
1. Create 0 - This operation creates an array.
/O
Decision
The process module has only one entrance
and one exit.
Process Module
1.8.6 What do you mean by flow chart ? Give the meaning of each symbol
Drau flowchart to compute the sum of elements from a given integer array
SPPU: May-10,
: Refer section 1.8.2 for flowchart and symbols used in it.
Start
Readarray
elements