0% found this document useful (0 votes)
17 views12 pages

FDS QB

Uploaded by

nidhi kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views12 pages

FDS QB

Uploaded by

nidhi kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

FDS b

Defun algotethm and 0xuain jts chasaeteruti

dlyoibAm is a step by slep pveedure, whieh


djinas a set
NtuLetiens D be exeerteal in ceatain
osdorogek disud aLctp
ChaAacteALties:

0 INput &hauld have O


o r04 weu-dujind MP
Outpu: shaud Love nuoe wel-depind olP and hould
hadth dusud ot

FinitenLs: A4o rut terrninh atr a fnih no of LPs


Unabigouy 4 houwd be clLar y unambig0us , mm
only ohL mianuy
Jead

nderundtnt : 4 should be
ideUNdLnt any p aNM
Feasibiuby hould be eavbu uth areilable sounes

e i n and eyluin

Data iu a ut o Lalus
quantLtatin o qualitative vatialu
Can be analyud and
n sualugLol uA4 gAaphi and imahes.

(1) 0ata Mustun


Dotta uctuu u noangemens al ddta n uch a way that
opakion can be
pnformad eieintly
310) FLOo chak 44 is th Raphical keNALLentatLon o an algaEtAM
i s vinLal and standatdizesl

Ynmbals

LO Andicato.

CoAMato

Hant stop

sgnmert enJuLnion

Decion making

E r L a u n divide and cOnque ratery w t utable eample


COmin4 dn tuni oMnlety

. P Mob tem u dinded intd nmalw b - fAolens and then eaeh holion
Lol ved indenendently .

n a u th ub oer a a u y rmelges int 0RodOA t o


abtaun the s0n he
o ogtnal Dbiem
MAg 60st Towe Hanai esoblem quick sou

shuyt au t h e Lo 6 olo
Chaging n oraler and LargerAuy
A b C
CoNnOt bc put en amaLle
Z u a secniwe
Ocess

E a i n 4symptitie Nototions with examui


(i)- (a)
A s a oLmal way o eapse the L0se bond o an
algo s
LA une
r m a w s het caye m e compluity

Hn)
cgch)

nCetn)) gtn):c
Sueh tak os Cgen) s FÜn)
foL all
fCn)= n n'
3n+2
gn)- 3nt27 cn => C & n
3n+2 ACo) n .
tyo (o)
ime.
a nethad o sefAetrtLng h upper bound o alyoAuaniny
44 nynnts w s t case umi comnluauty

n) uppelound

fn)

b(4tn))=3n): c>o n, , 3ueh ka


OS n ) s
cgtn)
t al n
n
+Cn)#Cn) 3n+2
9Cn)=n

f (n)s cgtn)
3nt2- S= cn

fCn)
n 3nt
2
n

3n+2 = 0Cn)
(ini) Jhea (0)
JMA a ormal way oghepnueti LetA uPpes and Lowe bound,
ase

Cgtn)

FCn)

C)

(fUn))tn) mcC0 Co, n,>o,


such tha 0 C2Ch)£th)< u9 Un)
o al n
7n»4
f n)= 3n +2
3)n

C2gn) ftn) s
CiCn) CI C2>o
no>1

tu oi CiFl, c>=4 , >


3n4 2-E e Cn)
Enpuain u i e 4 Dynanue dS toLth exanupte

STATI CC
DYNAMtC
tatic DS i an
A
oganisatior n Dynamie DS the Sia
ef Ds
data in memay Whish has on dyamiall now e Mune
a ied size.
as Ldea

A y
d tinkad iut
.

Ads umov adil elunt da|


iu huwce cons
suae Madiiy an elsmens
urun
mecess.

Fa a c A y o elormOns Moer acces-Ao elemnents

gUheentihke blo ineoi and nan-lnLas wih acoamla


ON uNEAR
LINEA

dala n a

g a r i r data in D S is
oyaNU
S4 DS i t called
a n d om o n d u ALen
quential ondal then it ,
NOn LNas DS
IS cauled inear Ds

C a y , ueuL G Te
Staee. intad (ist
a i n gAredy straley wuth suutabie
Time Pple v ( ecamp le ommap on
ih

tLoloLs J Mmdiate bes


em u ot so whuch can ae bea1
For lom tesm hay
coLntin coLs
(7to) des ed a u =
I

Gmedy appnoach
10+ I+I ++14
Global optium ol 7*HI)
aPproah pieke immeolia
ai galeauy epti mized n t opttmuzed vol° ahach a

peine and eplain ADT tAaet data TYP e


u a

is
matkematial maddor dasa Aypes shene a data p
damd by itt behaviou
4 s a
Logi cal des cnption e o we i e u the dota 2 he ep eratios
uwithout hugasd o hoo -Jhy wlu be
implennunted
16 i) Time Lomplerib

(i1) Space Compltity


Spade oMplex iy represenktR amourd ot eme ry spaea
Tead ly h algo in its ye yele
Spae is dapencden on dacta yPe e ai ven vaniaes

proble olv ing tkR

0Tdentiy th pnoblenm
Gi) ndergtand mokler
(iii) Iderk h autemate wayc o golH neb
v)selett b et way to sblue h e noL
v)is ihsthons uig sele tesl &ol
(vi) tvaluatt son.
amr
an
from
deletiny an el ement

Start
1g0 s e t T - ktl

4 whie J<N
rep eat step
LA[-I] = LA LT]
Set+ J-J+1
NN-

odetivcul <Locam
usg namsLace ste;
ine maun C)

nt k 3,o = C, iJ
COuut <<
'agunal ala"

jkt
wiuen)
LA Cj-1J] =La Li] ;
j=j+I

n=n-I
Louut< "A y ater dolehen "

toa 1=o t <n +a)


Cout << LACJ;

3
9ubum O
2Insert an ilennent in askey

And 8uile j7=k


ep ea
G L Cj+1J= LACi3
e-j-j j-j-
LALA LkJ= ITEM

UA

nde HLneude <os thean


wns ame dpace Std)

unt La lJ {I2,3,S,a,
int1E M =o k:4 , n- Sj n
tor (i O, i <n, i+4.
Caut< LAtIJ;

n:n+
whil Cv= k)

LA]= ITEM
Cout << " Prau ater inseh
or (izo, ien, i4+)
Cou < LA Li),
ewhat is hrray? Dis SLS di ker ent op on aray.

a a isaset et onseeutie memoiy Locaion


which cortoiss
sunill plemants

Operahons
O IMetuer
Dolenen
Thavesal
seach
Sodig

19 T a as an ADT

A' do4a tyre can be cons idered at ADr when it s dej'red i

+e opescctiors on it y x ik imPlenrentaion 1s hicden

w h a is DS ? 2xplqin cassceti bn DS .

DS is t h arsa entef data in eeuch a y n a t p s can Le


peomud en it eiienty

DHTA STRU CTUP J

Non-P sLNut i e
Paumiti

Loa

UaA Non-Lia

amy
tree
SHALK

quee2
25 Ad dre s) Calculadion furmala tor 4D aray u n epanga

Addn al tirdas|Baue+ (k-Le


ase z
t t i addus
si e doct ype
=
element whos cddhJ beir)
Colsalud
LB Lowu bound Cinde» )

22 sequerdia-ogantsatson

You might also like