Skip to content

Latest commit

 

History

History

divide_and_conquer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

QUESTION:

You are baby-sitting n children and have m > n cookies to divide between them. You must give each child exactly one cookie (of course, you cannot give the same cookie to two different children). Each child has a greed factor gi,1 ≤ i ≤ n which is the minimum size of a cookie that the child will be content with; and each cookie has a size sj , 1 ≤ j ≤ m. Your goal is to maximize the number of content children, i.e.., children i assigned a cookie j with gi ≤ s .