Question: Problem 5 - 4 ( ) 1 5 points You are a teacher at a preschool, and there are n children in your class with
Problem
points
You are a teacher at a preschool, and there are children in your class with happiness threshold
: You have chocolates with sizes : Each child should get exactly one chocolate.
If child is assigned chocolate and that child is said to be "happy".
Name Name Homework Page
a points Give a greedy algorithm to distribute chocolates to children so as to maximize the
number of happy children.
b points Prove that your algorithm is optimal.
c points Compute the time complexity of your algorithm.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
