sowmya
BAN USER- 2of 2 votes
AnswersConsider a system of n nodes numbered 1 to n. Each node has its id(1 to n) and a value associated with it say val. Now Every node has a send method send(int to , int val) and receive method int receive(int from).
- sowmya in United States
So if node 1 wants to send value , it does like this . send(1,val).
Using these two methods, write a distributed algorithm. Such that when the algorithm finishes, every node in the system knows the sum of the values of all the nodes in the system.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 0of 0 votes
AnswersSuppose there is a distance matrix which consists of n points and that gives the distance of say (a,b) = 6 , (a,c) = 5. If there are N points assume 10000, then it requires N * N matrix to store the corressponding distances.How to store the matrix in such a fashion that it gives a fast retrieval and optimized storage.
- sowmya in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm
RepRichardWParks, Accountant at ADP
I think you didn't understand the question. Every node should know the sum of all the values.
- sowmya February 20, 2013