Added on -2019-09-13

| 1 pages

| 223 words

| 741 views

Trusted by 2+ million users,

1000+ happy students everyday

Write working code for the Hirschberg-Sinclair algorithm for leader election using Java RMI/sockets. Each node acts as both client and server for its two neighbours on the logical ring.You need to decide on the details of the algorithm. Examples include: how to set the parameter n, who to choose/assign process ids, how to count the number of messages used 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 you implemented the algorithm in Java RMI or sockets. Justify your choice of RMI or sockets. 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 exact expression for the asymptotic message complexity of the algorithm.For each value ofnyou choose, calculate the average number of messages. Repeat this for various values ofn, e.g., 8, 16, 32, 64, .... Then plot the number of messages as a function ofnin a graph. Do your results validate the theoretical asymptotic message complexity?

** You are reading a preview**

Upload your documents to download

or

Become a Desklib member to get accesss

Paid Plans

Free Plan

Single Unlock

Monthly Plan

Yearly Plan