Answered step by step
Verified Expert Solution
Link Copied!

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 ***

image text in transcribedimage text in transcribed

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 table

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

Solve the given ODE. Show the details of your work. y i v + 4y" = 0

Answered: 1 week ago