Professional Documents
Culture Documents
PPS2
PPS2
Date
PPS 2
Arcund Misra
21BAL05
Ans wey1
Psendaco sle
Int aox Ele i a t AL,iat laint Ihh) i
law bigh)
retuwn ALlowL
alse i
int mid (lou+ bgh )/2
iat Lmax hox Ele CA la
int Rrmexmox Ele CA, Midt igh
return MaX(LmaxRMax)
imeLomplextu 0(loq n)
OMS Page No.
Date
Answer 2
Pseucda coele
Poiin,_iat2_max Ss (int AC1 it n)1
1AtMaX Sun JNT MN, Stout =0,
Dd O wwrent 0 4curessun 0
Cwred s t ArL1
iECCAred sun MaNSum )1
MOK SuME Cuwvei Sum
STowt Cwre -n-0
ondi
i Ccwrei sum 0 ) 1
Cwevetsm-0
awrerd = í t l
Pscucda.cod
Pair ik,ial Max$S Cint ACL intn)
int maxSwm0 :0,erd-0 Luret 0 LSun=p_
COtm 0
else
Sum tE ALLL
i C Sn MxSum)
MOX SM2_CSUM
Gtout- Curvent
end iL
CSwm z0
Curent = i t |
c)
Krudo code oi noradolqrih tov
MoXI MUm 5uwb orvy Sum_wowd
Pseudocole
Pair id,ind max $2 lias ACI id n1-
IndMaxSum:0,stout 0 prd:0,_wel D,Ls
LSuM t_ALi
tCcsum Mas Sum) /
MaKSwm cGum
stout Cwrend
end i
LSum 0
Lurvent Ei+
etsc i£ CA 20)i
loal= stot-
if Plaa2-) _
tloog=04
Answer3
Lagie Divich and LOnque
Pseudocde
in iNauat Cint ALI it o)i
tTLA
retun calc LA,T,O,0-D-
int_cole (it ALI id TCI, at Liat Ri-
af_Md COnt - 0
Mc L+R)/z
COunt t Colc CALLoicd)
COuat +E colcA,L Md+L R).
_Caut P1NeAT,L,d+L R)
refuwA Cow
Answer 44
aet b af tbh
Cd Lgh cetdg of+h
Peudo cocla
Compenh OCND