Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are a conference organiser and you are asked to organise a conference for a company. The capacity of the conference room is limited
You are a conference organiser and you are asked to organise a conference for a company. The capacity of the conference room is limited and hence you would want to minimise the number of people invited to the conference. To make the conference useful for the entire company, you need to make sure that if an employee is not invited, then every employee who is an immediate subordinate of this employee gets the invitation (if an employee is invited, then you may or may not invite a subordinate). The company has a typical hierarchical tree structure, where every employee except the CEO has exactly one immediate boss. Design an algorithm for this problem. You are given as input an integer array B[1...n], where B[i] is the immediate boss of the ith employee of the company. The CEO is employee number 1 and B[1] = 1. The output of your algorithm is a subset S C{1,.., n} of invited employees. Give running time analysis and proof of correctness.
Step by Step Solution
★★★★★
3.44 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
include include define N 8 number of employees using namespace std Note IDEA IS 1 find level of each ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started