Answered step by step
Verified Expert Solution
Question
1 Approved Answer
NOTE: ***You must also prove that your algorithm is correct and analyze its running time *** You are planning seating for a wedding, and would
NOTE:
***You must also prove that your algorithm is correct and analyze its running time ***
You are planning seating for a wedding, and would like to mix-and-match people from different families so that everyone can mingle. However, you only have a limited number of tables which can each seat a limited number of people. To solve this problem, you will come up with a general algorithm that can either match people to tables so that no two people from the same family are seated at the same table, or determine if it is impossible to do so. The input to the algorithm will be the following. You are given a list of n positive integers f1, ..., fn, where fi is the number of people in the ith family, as well as m positive integers t1, t2, ..., tm, where t; represents the number of people that can be seated at table j. Give an efficient algorithm that will decide if it is possible to seat everyone at the tables so that no two members from the same family are seated at the same tableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started