You are on page 1of 16

Samyake

RounoF2512001

Eaplain the faMawing gen eal problem Seluing


stateqies in detail
iide and conaec
LoPiNide and COnquc takiag a
technique iavolwes
Large Scale eroblem and ividiag it into
Similar Subprahlems of Somauar scaLe
n d cecursveysalvingeach of these
Sub problems aecaly,a prablena is dividedL
iate suh pcablemscepeatedlynl the
resula sub pcoblems. ar Very eay
to solue
AE ter Soving the Gubpraklemyiadiuidually
are compiled tapother
egeample for Salving mathemafcal eauahae
caa divide the solwing intosteps
$4ppoGe cwe haye tof Aad the raots of
an eauation we wiU folaw the fallastag
Step
9iven eq : a e+ b + c=0

find a , b,c

Use
2 a

|2a

Vy-acI
2a
Name- Ayosh Butala
Roll n umber - F23112055 Pnga No,
Date

Q8 Explain tollowing geneyal problem solving strategies


in cletail
OTrial and Exror
Dynamic rogramming
Dypamic Programming
o This me thocl is bsect ewhen twe have to build up
Soluhon to apoblem va a Seqienteof
intezmedia te steps
O Thi strategtesis sel in optimi2a han pre blen
6 For example for fincling out He Abonacel
DbmbeYs jn Qaseaes Fibonacct sens is a
Sequence ot numbessinuh'ch Current Oumber
js the Sum ot prevlas two num ber
L,l, 29 3g 5, , 13, 2L
ORial and Eror
If at frst you don't scceed, try agaln
des cibes tial anl emY
This is not the most time -effkient Strategies
but it's Common ly used one
for example - for fincing out which numbe
there onder the box will choike the rovided
ophons .If the chosen ophon is wrong we
Loill try again t find the Comect canse.
Cuill Contnee this tll we don't tincd tte
Sat conect oanswer.
classMAte
Date
Page

Q) Explalin the tolloucig top daon desian n detail using


sitalole enplalnahen.example
a) Breabing a a polblem nto subprolblems
The process ot sepeatedly breaking otacc
Subtass and then e0ch Subtaske doonirh
n Snaller subtocts
must Conbnue unbl e evenbally end up oith
Subtesk hat con be nplemened raclem
Shrdements
Erample And oets
oots o auadrahe
quadrahe eon
Find Roots

Fnd -b Findtb-4a Hnd 2a

Find oots using

cholce ot a sultable data struetue


Approphate chojce
choi ot data chructure leads to
trongporent and ehaent nnp lementahan sinple
Organizahon dota have ete on evey as ped
nal olukon inapopnate choice d data
struche leods to inetuent ancd dikiut 'mnplement
he poblem an be tormulated 'n terms t one
COnmon
data Sructyes e
eA 0ray stntk, queue , set, gaph, Unbed list
Name - Mansi S. kukarni
Rolloo. - su
Date
Page.

Eaploinollbsingtnp dbian desighin detcil


Wsing Suitable e2ample.
OConstruction
gns
otdoop
Series ofterout ve Con sthucts L,loops structures,
input output tatementscomput cLble expres sio0
4 assignmeots mke he
implementction. hearto progtam
To
canstructdooptolloucing
Conditin ns
hings necessan
applied betore the Joop beqins
toe2e cte

tavarìant
which applied attereaoh jteraton
otheloop

9) Terminaingcondition
The Condito n under uhch the ite taton
process. +erminate

begin

condit'on True Jo op bo dy
sadse

End

Isdys

SIl (T
Date
Page.

£sta blighing initia) aconcitionsooops


ans OTo establish theniniti atcohditionsD aJoop,
Set the
he lonp Vaiables. +o Hhe
have to àssumeaio Orderto solve he
Slest prOblem associóte d withtbe non
D The no o iteration othat mLstbe made
byaJohp Are in the ranqleon.
3The Smalest prohle usuatycorheiponds to
the COse toheeaj either equ als
equals 1
o onumbers the
ig tn inding thesum
initia Volue ot index 4Suwi bezero.

find the SumD setooÁumber S


Soln
-se+ Variableos"
Sum. Variable
- The sumot zeroifDumbers is zer0

Values Zero

J: S:0;
Name - ranalee Raut
Roll no- 36 PWGE
DATE

Explaio-foll owig top down dign io detáil


ucinq guitable evanple.
Finding the Herative congttuct
) Oncé Loe have the tondiHong or solyinq the
Smalles
poblern the inet gtep is to
extend it do he next omallet poblem.
y to
5 I 0e have 80 lution fors n= 0

then he golehion Porn 1 o-l, goluhom

he en)uion fom n 2 is
tor n 2

41he game seps c¡n be used to extend the goluhon


to the genetalzed onlaion for n>o a
‘ generalireg for
Sume gum + grr n>0

These too steps coill in qeneral extend he


aolution rom the (-1" etase case to the ith ca se
Caohere >), They can 4herefome be wied oas the
basis o terotive construct tor golvinq the
problem for n4
Tnitializatim Condiio torl00p aoo golution
to Qumming pmoblem uhen n: O
tohile <n do golution the
Soltien to beqin
isummation oblem T+! surnmation
for n20 Jproblenn tor
end

Xondition

Block
f atatements

exiF

Termination ot l00 p:
fbere me numberg oye in ohich loop
can be teminated.
The sinnple conditian Por terminahng a oop
OccUms when iFig
known e in o dvante ho
many iderationg need to be made
T 3advance oe knoo n number of iterationg
then fo Joop in Pascal can terminate
uncondhon a) y aftern iterahond
tor i=1 to n do
begin
end
Asetond oay in aobich loop can terminate js
hen gome conditi nal erpreasion betome polx
Example:
while (n>0) nd (me10) do
begin

end

egelemenhs
conaiderio Ahe pmram af asrangingn
degCending onder
ag a f1] >4f]>.. >aCn]
pox thig Can ite

tohile a > +1] do i: i+t


let n = 5 and a18,16, 1o,3,18|

In thig cate ohen i = o the loop will


teroinae coU10,9,8]
But if o18.

In thig care it usil) ndt erminate corecty and


wil) go in to intinite lo0p go 0e need add one
|more condiion s ien $o the fina code w||
be =2
abileCa [i-4]>a [)) and (ien)
Ansata ydan
Roll oe. o8 pie

1c3ite chot ngte cni

Aduantage, f algsihm
Algethm An algeithm sa nite get o intd

sinsple Engilsh Ianquage

a qiuen problem hich mak, ît exas te wnderhs

hTt Gs conten sinnple etnqlch languags he

ptxoning Hncaeledge.
wquly cenc and cnly cepshd on he nput and

)P By wing aigonthm the problm is bronken clest


PYOgrmmer to Convet into ctual pogram

6Gencrallsed algcrithm
hener aiSation algerithna contitut the beildina br

Generalizaticn refers to on algcith's cagactty t


0p plcatic
classmate
640 ab Date.
Page

Exanple -
An algenthn hi ch adcs2 numbos and gtot the
resclt in a third yaiab le

tep 3tart
oep2 Reaci the Arst numoex fin yañabl e 'al
Steps Read the gecon nunbe în vai able b'
Step4 Pexfox m the additen c both the num ber s ahd
g4ore Ahe resut in uai cblec
Step5 Pynt the uale s'c a erest a adaticn
Stsp Stop.
Shavo Ai) Khal odleor. classMAte
Rol). No g- 40. Date
Page

algoithm 9ehesalized 2

adgotb d the indtuciond for penbsni


a pahcul at toulk The inuuctions
nothing but Hoe stadememta dimple
Engha languag
Exounple
Bn algathmwdhichadde 2 mwnbesd
Jhhe the elt in Hid vabziable
Stot
Read Hhe A t haber in vasiabJe a'
Read Hheecond h b e r in vauable b
Per sm the addiionoA both the aunbe
a n d e the edu+ in
Psun he value c' cu
additios
Stop
2number)
b 2
g+ b
paint ('addiion is'yc)
Out put
Name - Kashi RGrey al Page NG

YOUYA
Rol no. - 14 Date

ininite sep Ho)


91D What is meant by
Qroi d intinite deps.
o code that laca
sep iapiece ef
esut and 't ca ndeinilelyi
uithot
Same of the alins
The psag 4Om neve step n an inginie Joep
be
can be auroided ik folleuing
Inite ueps
DBy ceuning No. o tepekiton is limaled bya
ficed CALnt
Once thefned count is sueached the pbq sam Staps
Sy wng sentine alue (Guad vau
special alue which is used to
teumnae Hhe oep

while uc i
pint ( This i an ingiik lep)
Qea) ahalag dilfeenl woys eprcint ing
algorihm.
Algozithm, An alqorithm ic preclie
steh by sep sel of inshuttionger salaing
computatiamal pcblem

tdyonto gt aqoifhm
Shep toise spresenta!n maty i eiy
Nlgorilhn lor even odd unction
Slep
Siep 2: Slart
Step 3 EnteY he numbet
Tf henumb!Y )s divisíble by 2 and
Step a
emaindey 2e10 pTint evem.
Ë he num bex is ncl
divisible by 2
and gemaindu i nolequal lazero,
piint odd
Step s End

lou chas! or tyen odd funcdion

(Btorty
Enteya nunbt

n /.2 = =

yes No

Patnt Print
Odl

(End )
Pege

Pseudo AqoviBhrm
Sfept npul no =
Stcp2h/.2 ==0 eYen

Stcpy: End
Namt:- Ashw any a Suryawanau
Roll No:- 46

Q 13)
What is meant by prog ram plant
)Creatinq. program is third stage or coding stag
)
gefore
) oa,atgn the
IH Is an as essertial as planning
pngram
Ohstructo
af bulding beforxacualy biding it
Ih simple words,Proqtan
process which takes you from ideas
planniHg
action and then to Cn evaluation
which tells you iF you Were cble to
accomplih your ideal Ta
In "mavin fia ldeau to acton, " you first
need ide anà then yau mt put them
ento lHon.
Ex. We have to plane a proqram We neee
flow chat oy páeudo code ox stnutur chad
Now, etbs cansidex pseudo code foi isplay
larqex numbr fiom wo humber.

skpti Scan 2 inteaess af b from Lqes


stp2:-i f azb then display a
Step2i- eke display b

You might also like