High school students and their parents often visit college campuses and see an i
ID: 3854508 • Letter: H
Question
High school students and their parents often visit college campuses and see an introductory movie in a lecture room. Suppose the room has 100 seats and the people who came in the same car/bus must watch the movie together. How would you, as the campus visit director, arrange all the people to watch the movie with a minimal number of showings. Suppose c1 , c2 , ..., cm are the numbers of people coming to the campus by the same car/bus, where 0 < ci < 101. One solution is firstcome, firstserve: if the next group cannot fit in the lecture hall, then the hall shuts its door and starts the movie. The second solution is bestfit: Always send the largest group that can fit into the hall, until no groups can fit. Unfortunately, both solutions are not optimal. Provide:
A. Counterexamples to show both solutions are not optimal. (10 points)
B. An optimal algorithm with its complexity. (15 points)
Explanation / Answer
Algorithm:
Hence, with the help of this algorithm you will be able to join the show with the minimal numbers of the showing and the people will be gathered in the show together with less problems.Hence, this is the best solution of the algorithm.The complexity of the algorithm is 0(n).
Counterexamples:
Hence,from the above examples it is made sure that both the solutions are not optimal and have loopholes in each of them.
Please rate the answer if it helps.....Thankyou
Hope it helps....
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.