Binary Search Question3 Answer
Binary Search Question3 Answer
EE
① Book Allocation
§
20 30 40 50
m⑤
, y
Books
pa⑧
①
.
→ Students
0 I 2 3
n =4
20 30 40 m=2
ñTÉ÷_
÷TE÷±}→a
→
' ozTÉ⇐
10 20 30 40
m=2=
ÉF÷→
÷¥§→↳o
out
a-
LE
"
'
case #
,
can
1*40%1>4--62
- -
Go
→
Concept → Search space → minimise
⇐→
o #
ans → search space
10 20 30 40
→
min 100
-5=0
=
max
too
No solution
mid -
-
So
s=mid_ →
exist
is Grid )
Possible Solution
T
m
mid
-
£ I 2-0 µ 3¥ tf
✗ I→
+2
m=①
±¥¥
51 _ É
②
mid -
Sol "-€
l02O3o⑧4O- Possible
↳ one store
↳
I →
-3o +4g left-Hand D -
↳
✓ minimum
I
→
yo
✓
It is a
possible solution
s .
-7%5 ②
mid =
(51+2-1)=1252 = ④
mid=6① to 20 30 µ 40
←
I → 10 +20
4-31 Soh exit
→
I →
My
?⃝
?⃝
s
mid -
(11-3) = 51
N°± "
10 20 ⑧ 30 yo
Ñ
I →
+20-+305 m-
I → 30 1- Yo
✗
→
4g
sÑ 61
mid -
(57-+1)=(118-2) >
51
10 20
µ 30 70
30<=592
É÷-*÷É¥ I -7 30 +
⇐ ⇐
70<=594
%
→
a ↳ No_
?⃝
?⃝
e- Go
mid j ,
e- 59
?
mid
60T¥ -
to
wwÉ
10 20 30 ⑧ 40
10<=60 =
I →
¥t 304--60 =
I →
④
# possible
60<=60 =
Sol
' 100<=60
✗
L yo=
an .am
:
?⃝
51-5%-61
mid -
56
10
2--0 3--0 Yo
I→ 10=+20
'd
p
<
0=1-10--10--3 to = me
→
10<=562,
101--20--3-0<=56%1
=
=
③ 1-3-0 =
6o<-^
* ←
⑦→3o<=s#
I
Knut
→
pagesuin-anli7-peyeswm-ogpag.gun.G.g
p
PagySum=B_o+÷
Painter 's Partition Problem
Hfr
→
an →
2 - - -
-
-
3N
K→
painter
Painters
wntinow"h
minimums
-
5
-
s
5
•
µ 5
*
5
N
②
K_
an →
g¥%
f)
II 5+-5 10 possible
I:÷I
=
→
II → 51-5--10 -
0T¥ ,
④F⑦④⑧
I→ 5¥ F
s _g
S e
m 'd -7
55--53
I -35
No solution
Is 9
•É
sinid
,
°
§, ¥ , I ,§
I→§
→ No
I
✗
→ ÷:*
-50
f1→
a- to
Its
↳ Out
IIIX ofwhite
mi → No ,oµ loop
?⃝
?⃝
Aggressively ¥9
"
am 23--14 iz .
. I ,
3
,
-63
ai¥z
f-
ciÉ2
C
É> C2
,
c c
, ,
c. ¥
ciÉz
C
Cz
4
⑤
,
ci¥
4 2 I 3 6
Cows =3
s¥i☒?o_ -
AB
negÉ
.
- fom ✗
÷÷
42136g
0
#É=sP°M↳ars=
s-i-=m%
2
m¥ uppish
=
i¥- '
" ÷
¥→
Dz-TRk
possible
,qsright
store
part
#÷y
3
mid = 4
or
-
Possible
↳ ans -
4
↳ Right
s§ ÷ s
,
e
<
a
,
a
<_É
mid 5>
L
s -
e$ see
P
"
'bh¥ans
e- 5
tµ# → =midH
2¥
>
→amci )
/
cool b-a>=m
am[i]-word>=m&be
place Kodo
FÉ=±s
<
0¥ > 6
¥s
a
:# → anti
]
doth b-a>=m↳
pbe c-
aM[i]-lastpes>=mi#
Allocation
Ri_=
→
Book
→(
lows
Aggressive
4¥
More Question
→ EKO SPOT
→ PRATA SPOT
→
Beautiful Triplets Earth)
(Hacker