Education + Jobs Hiring Website - 2025
0 like 0 dislike
26 views
We are given a hierarchy of a company as a tree form and each node in tree has a contribution

We are given an array of these contributions as Level wise traversal of tree

(So we were not given tree or edges ..but I used
ith node has its children 2*i and 2*i + 1 position)

Now we need to maximise our score

1. If it choose manager i cant choose its children
2. If the manager is key manager (the node which has both children is called key manager node) either we can choose it and use rule 1
3. Or If I don't want to choose key manager choose one its children not both atmost one
ago in Online Assessments by (440 points) | 26 views

Please log in or register to answer this question.

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .