Answered step by step
Verified Expert Solution
Link Copied!

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Hard Decisions with decision tools

Authors: Robert Clemen, Terence Reilly

3rd edition

538797576, 978-0538797573

More Books

Students also viewed these Algorithms questions

Question

What is the wavelength of light if its frequency is 1.009 106 Hz?

Answered: 1 week ago

Question

What steps do you take to set up a RAID array on Linux?

Answered: 1 week ago