Wednesday, October 20, 2010

HANDSHAKE PROBLEM

There are 20 people in a room. Every person must share hands with every other person in the room. How many handshakes have taken place?
Algorithm: n
1st Person: n-1
2nd Person: n-2
3rd Person: n-3

(n-1)+(n-2)+(n-3)+(n-4)+(n-5)+.....+(n-19)= n(n-1)
                                                                              2
 


No comments:

Post a Comment