Challenge: Dynamic Programming
Explore how to implement dynamic programming by solving a problem that requires maximizing the total fun rating of party guests while respecting managerial hierarchy. Understand the recursive solution to decide whether to include or exclude each employee efficiently using a tree structure in Java.
We'll cover the following...
Let's practice what we've learned so far.
Task
We’ve just been appointed as the new organizer of the first annual mandatory holiday party at Giggle (a subsidiary of Abugida). Giggle employees are organized into a strict hierarchy—a tree with the company president at the root. The all-knowing oracles in Human Resources have assigned a real number to each employee measuring how “fun” the employee is. To keep things social, there is one restriction on the guest list:
An employee cannot attend the party if their immediate supervisor is ...