Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Name Neha otngh

lRoll no Assignment 1
olUa20020032

Nhat is an Algauithum 2
n s - t is a_combinaton t squence offinit shtps o 0lve
apahiculan pMoblem

al is a el defined p1ocedwae tahich afl take a nit


t as inptut and pHaduce non-tmpiy St at output

8)Algamdhum is geniic pHog.Hamming language hecause ff


USed a s a quidelines soVe any p1oblem usina-
dRSIHedH0gnamming language
)Nhat a1e athe ehu Chauaattnisics of alauithum

blel-Detined Wall-Defined
Inputs Outps

Tcteaot and hmileness


Orumorgtoto a Atgoritum

Longuag.e Fetarbt e
Tndependend

Sgnature
Page No.
Data

Hgautham must haye the bllocolna chanactiishica


O CleaH and nambjauous healganithum should he clear
andunambiguOLS mch af f
tteps choLld be clean in all aspect and mlsf _lead fo
ong one meanin0g

B Well-Detined Inputs-T an algoithum 6a oake înprk


should be ael-dehned input,
H mauOH ma nat dtake inputs

( ) |alell-Detined Oupuks-lhe alganihum must clealy dehine


ohat acutput aill he giclded and
shald be tel-de-fiend as aR T shoculd p10oduce at leazt

)inike-neas - he alanHithum must he fmte e


should teaminate a q Hinite ime
(5Rea.gible-he agnutthum must he simple gen81C ond
paia cHical, uch that mn be exe cued witth the
lavaliable HesoiCeA must not COYntn 'n some futuIe
techmalogu o1 athhmg

lanauage ndependentlhe tlgonthun dasaned mukt he


anauag
independen, 1
musE be Ju plain instHu ntion hod mnn be mpere
mang lanauag dnd e he outpat l l he a
0S PXpeg hed

S Signature... e
6)0chne sunto-ic Naiafon 2

Asgmptotic notitOn aie NMaHilausedo_descHibe he


na dimeAO aanithumshe1Unning ime
lalganhum she dime needed by annlgarithsm
lin ind 0 deliveM auput ohtn pciented coth
legal inpt n_aGmptadic nataimn on alganithum i
heoted 6 q Auncdion
lMennedhe dRhm pegudocoole and Ho choMt

Feccudocode

fn mima hiah-Jevel descalphion a he


ApaNCtiNg pHinal'plR f an agoHhu n

AlMen_in natwral lanuag ad moihemo~ic.al


nomkons help h he atk percuaboode
Pseudo code MHen maHe clae zn pgN2Mming-
languoeL
fsaudo code avotos voxiahle declanatian hut theya
1aHTEn uSLmg SOme actual p09Namming langaa q
consuc lko C FORTRAN gnd fhscaletc

piOYIdar q methad to peittnHmhe nskas


4omputey fs PXRCLHing he coode

sSignature
Page No.
Data

Hounchal

A digga mmatic HepHeSentationhat PlusiHates_


Salulton mad e o aaiyen pioblern
WNn usm voÁlous umbals JIkeLGtanale

Iheg ane rordely dsed in mutide i Held s to dcunen


Sud plan, imaHaVe qnd- omm unicate atn
OmplpypHOCess n cleQn enSyo-UdRidfand dihgHam

HonchaR somtim e speUed gs F00 choHt, yAR_


eahangle oval& _dfamond dnd patenfally_
numRnaus 0the1 hapes To deine hetupe a ep
alomg 0 h connectino a o o o deFne lo
lamd eguen Ce

hey ae hmos one of he most COm mon


diaua nmg onhe plane used h hothechnlc.a
nOn-fechnicol peaple m numeiOUA HRld

FloochautrS aHe somehimes called bu maHe cp.clnliz2n-


name uch ag iocexe losocha HnCEAC MaP
funchionol BloLncha uaOeA MocS Mappfn
Hoceslon diaaHam(PED)-

S S1gnature..
Dal9

Explainhme and Spa.ce complexilyot any algonthum


o h eXamples.

Tme Compl&xlu Ihe me comple xi ot an alaot


alaontnum is qcuantifeshe
amoun t Hinme taken an algaHhdm nHUD a
naH an 0 he deng-hhe input.

lEX Thesimpleat dea f o onsidarn eve pn b


check iE dmhHtea he aiven a condttion ay na
he lgodhums aAollo

int q[ni
in q
fhi Cin
fan Cint J=0 kn
tun_alse

Mtuin-alse

Spce Complextulhe spa.ce complex o qn algaHihsms


quantiTA he amaut OF pacotaken
by qn a l g a u h u m t o u n
gs-tinton he
enghg he npu

a RHO Dlem n tindheprequency a


Ex uppase
gm anmc elemenT

sSignature....
Page N0. PeaceeksR

he AlgoRHhum á an allouax
int hieq Lnl

cin 77 gLi

G)Golye he ollgtoing HeCence 1elatan h9 makten


hen em
Tln-AT(n[R) n

aiyen I(n) =aT(Y2) tn2

TEI ( fln)
Tn)=2T (n12) n
2b= 2 Pn) =n2

In)=n un
u(n)
n uln

n n
(n

TIn T (n)n
's Signature.
Page

Gfven TN)4T(Dla)+n3
Tn)=aT(n/)f n
Q4 b 2 Pn)n
TCn) n in)
Tn) n2 log ln)
In) nlog u(n)

T(n) = n2togn
E(nHogn)
Tin) =16T (n/8) +n2
Gaven, T(n) =I6T(n/8) t n
Tn gT (/h An)
a=lo b=8, FnE nt
Tn =n91 uln)
in= n8 n
TCn nlog u l n

Tn) ndlagn
(nlon

sSignature
Pags No

n3T(n/6) tn
a ven TCn)8Ianlo tn
Tn)_aL(n/bKt LnJ_
E 3 b - 6K : 2

Tn)=n0a uln)
Hn)=n ac2) UUn)
Tn) nloga2) uln
T(n)=nog
T(n)= n2f1ogn)2

SalyeheollocmingHeCunMence 1alat on b baok_


bsiuHon mehod
Tn)=In-1)+ n mPth Ta)=o
fini-TLn) Tn) +n
pctfng n=2, 8 4

TC)TO) tL
TCA) T) TR

)=Ts) +4
ICn Tn-2) + Cn-1)
T(n) T(n-)+n

Tn) TCOtn(nt1)/2
TM) TM 1)tr
s SignaturG
Penoeel

(TCn-) (n-))
T(n- +(m) +m
T(n-3+ (M-2 i (n) n-
+ (n-2) Hn1)tn-
K

n(nt
2

(8 lve the ol| oo'ng ecuence elaian hy back


Lbattuton Mhod

T(n)=T(N1) n coith IO) = 0-


C TCn)= T(n-3 + C_ athT CD 1
TCn)= T(M=I)+ n
Ttn=1))tn=l) n_
T(n-2) + (n1)+n
(n--1)tn-2) t (n=1)+n
T(n-a)+ (n-2)f (n-) tn_
TO+2t8+ -tn
tn
nCnti)2

In)=(n1)/24

$Signature..
Page No. Reaenc
Date

Tn) T(Dla) C
T(n) T(M3) t C
T(Tn t3)-) t (n/) + n
=I(na -1) + (niG) + n
T (nla-2) (n/a) +(nl2) t n
T(n)t (/2) t(n/a) t n

T1) 2t8t
ncnla)
T(m) = n(n/a)/2-

(( Solve the tolloc0lna HPC UAI en ce elatton


MeCLLMAàn ee mathod

Tn) 2T (2)+ C
Tm)= 3T (N) + Cn
n) aT Cn/a

TtTr)
s Signature.
T) t T) t

Hetaht o-f the ee Chj = lma n)


h 2 n)
Numba OF (eavel=

Tn)ct c +YC tnE


Tn) an- O(n)
Tin)= 3 (n/4)+ cn
Cn2

Thl I(n/u) Th/y.


Pape No. e
Date

Cn

C(ya)2 GCn/a) c(n/u2

Tnis)-T{1a}te) TnlLc) TMIa) TfVa6) T(i6) Th/le T(Y)


Tna

6t
's Signature.

You might also like