puzzle: N persons sitting on round table. No of ways of handshakes without crossing any other handshakes

user2328404 picture user2328404 · Aug 6, 2013 · Viewed 10.8k times · Source

We have n persons sitting on a round table. Any person can do a handshake with any other person. In how many ways these n people can make handshakes so that no two handshakes crosses each other.

I found this puzzle in a technical interview forum, but no answer. One way i could think of was find all the permutations of handshakes and then check each permutation whether it satisfies or not.

Can anyone please sugget any other solution which is more efficient.

@edit: Clarification from comments: N would be even.

Answer

Buhb picture Buhb · Aug 6, 2013

I would try a divide and conquer solution. if person 1 shakes hand with person x, it splits the rest of the people into two groups, that can be treated as sitting at two round tables.