java - Divide n Conquer (Secret Sharing through minimum calls) -
there n number of students in class. teacher tells 1 secret each student. way share secret through phone call. using divide , conquer, design algorithm find minimum number of phone calls required each student secrets.
one of friend asks me this. put time make sketch i.e. have array of students , i'll break recursively until have 1 student , upon joining them i'll make count call has been made between these two.
while combining 2 pairs i'll count 2 calls , on. point troubling me or may here missing something.
x1 x2 (1 call) x3 x4 (1 call) x1 -----> x3 x2 -----> x4 (2 more calls)
any assistance appreciated.
the optimum scheme n>=4 people share n pieces of information 2n-4 shown in paper.
the divide , conquer approach problem illustrated follows:
for 4 persons a, b, c , d, say, take conversations ab, , cd, followed ac , bd. every additional person p, schedule 1 conversation ap, before a, b, c , d interchange knowledge, , conversation ap afterwards.
Comments
Post a Comment