Write working code for the Hirschberg-Sinclair algorithm for
Added on - 13 Sep 2019
Write working code for the Hirschberg-Sinclair algorithm for leader election usingJava RMI/sockets. Each node acts as both client and server for its two neighbours onthe logical ring.You need to decide on the details of the algorithm. Examples include: how to set theparameter n, who to choose/assign process ids, how to count the number of messagesused in a leader election.Build an appropriate interface, to demonstrate the working of the algorithm.Turn in a printout of commented running code; and a 1-2 page writeup of how youimplemented the algorithm in Java RMI or sockets. Justify your choice of RMI orsockets. Give the summary of how many messages it took to elect the leader, averagedover a large number of runs, for each value ofnyou choose. Also, derive an exactexpression for the asymptotic message complexity of the algorithm.For each value ofnyou choose, calculate the average number of messages. Repeatthis for various values ofn, e.g., 8, 16, 32, 64, .... Then plot the number of messagesas a function ofnin a graph. Do your results validate the theoretical asymptoticmessage complexity?