You are a conference organiser and you are asked to organise a conference for a company....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
include include define N 8 number of employees using namespace std Note IDEA IS 1 find level of each ... View the full answer
Related Book For
Making Hard Decisions with decision tools
ISBN: 978-0538797573
3rd edition
Authors: Robert Clemen, Terence Reilly
Posted Date:
Students also viewed these algorithms questions
-
If an employee does not complete a Form W4, the employer must withhold tax as if the employee were single with no exemptions. True or False
-
Many would argue that if an employee receives a decent salary, he or she will be satisfied and remain with the organization. What are your thoughts on this statement? Does compensation motivate...
-
Given an array of n elements, give a linear-time algorithm to rotate the string k positions. That is, if the array contains a0, a1, , an1 , the rotated array is ak, ak+1, , an-1, a0, , ak1. Use at...
-
What is the wavelength of light if its frequency is 1.009 106 Hz?
-
Describe some surveying applications in: (a) Construction (b) Mining (c) Agriculture
-
On January 1, 2020, K. Crew Inc. reported a $6,000 credit balance in its Accumulated OCIPension Gain/Loss account related to its pension plan. During 2020, the following events occurred. Actual...
-
Using the density function of the stopping time probability for a fixed \(\lambda\), find the average time to the first event over the entire interval \([0, \infty)\).
-
The Biological Insect Control Corporation (BICC) has hired you as a consultant to evaluate the NPV of its proposed toad ranch. BICC plans to breed toads and sell them as ecologically desirable insect...
-
As Kelly gained approval for the project plan now, he has to get the security clearance from the IT administrator to access the site. To gain security clearance, you are required to write an email to...
-
A steel distributor cuts sheets of steel from coils supplied by major mills. Accurate forecasting of coil usage can be very beneficial in controlling raw material inventories. Eighty percent of the...
-
The redundant code will be eliminated by adding a new method to compute and print the cost based on item weight. Update the program below to add a new method calculateShipping that has one formal...
-
Using an approach similar to that in Worked Example 19.1, find all words with length of at least ten in which no letter is repeated. What is the longest one? How many such words exist for each...
-
Repeat Exercise E25.4 , using a DTD for validation. Data from exercise E25.4 Write a program that can read XML files, such as: 3 1295.32
-
Write a program that uses a database of quizzes. Each quiz has a description and one or more multiple-choice questions. Each question has one or more choices, one of which is the correct one. Use...
-
Bethesda Hospital has recently developed an occupational medicine program. It wants to target employers in the Baltimore metropolitan area. The director of the pro- gram has a range of services...
-
Write a program that reads an integer n and then prints all squares of the integers from 1 to n that are palindromes (that is, their decimal representation equals its reverse). Use IntStream.range,...
-
Add a fourth force to this system such that the resultant of the four forces is zero. Give the magnitude and direction of the fourth force. Use any graphical method. 800 lb 1200 lb 800 lb
-
What are the six activities involved in the physical supply/distribution system?
-
To help counselors identify teenagers who may become problem drinkers, a psychologist created a written test and individuals with scores above 75 on this test are flagged as potential problem...
-
Assess the probability that the New York Mets will win the WorldSeries (WS) next year. Call this probability p. Now assess the following probabilities: P(Win WS | Win Pennant) and P(Win Pennant). Use...
-
Consider the following situations that involve multiple objectives: a. Suppose you want to go out for dinner. What are your fundamental objectives? Create a fundamental-objectives hierarchy. b....
-
Indonesia produces about 60 percent of the worlds palm oil. Palm oil is used in the production of shampoo, ice cream, and chocolate. Assume that Switzerland does not produce palm oil but companies in...
-
An article in the Wall Street Journal stated that Chinas treatment of American know-how has been a central issue to U.S.-China trade tensions over the past five years. a. What does the article mean...
-
James Halperin, co-chair of Heritage Auctions, was interviewed about his experiences auctioning rare coins. Noting that when the auction house first opened in the 1970s, I used to proofread every...
Study smarter with the SolutionInn App