Computer Science, asked by nikkubhairam8408, 7 months ago

write an algorithm to handover a book to one of your friend

Answers

Answered by vishal10495152
0

Answer:

Given n friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find out the total number of ways in which friends can remain single or can be paired up.

Examples :

Input : n = 3 Output : 4 Explanation {1}, {2}, {3} : all single {1}, {2, 3} : 2 and 3 paired but 1 is single. {1, 2}, {3} : 1 and 2 are paired but 3 is single. {1, 3}, {2} : 1 and 3 are paired but 2 is single. Note that {1, 2} and {2, 1} are considered

Similar questions