Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Problem 1 [25 points]
A company is planning a party for its employees. The organizers of the party want it to be afun party, so they have assigned a â??funâ?? rating to every employee (for any employee x, xâ??s funrating is denoted by fun(x)) and are planning to invite employees that will maximize fun.The employees at the company are organized into a strict hierarchy, which is encoded as atree T rooted at the president root(T) of the company. Each node is an immediate supervisor
of its children. However, there is a restriction: An employee and his immediate supervisor(his parent in the tree) cannot both attend, because otherwise there would be no fun at all.a) Give an algorithm that makes a guest list for the party that maximizes the sum ofâ??funâ?? ratings of the guests. Denoting the total number of company employees by n,your function should have O(n) time complexity. Show the pseudocode, argue that youralgorithms is correct, and argue that its complexity is indeed O(n). Again, make surethat for any guest, the guestâ??s immediate supervisor does not attend (and at the sametime, that the overall fun rating of guests is maximized).
b) How would you modify your algorithm to always select the president of the company(regardless of his fun rating or the consequences on the overall amount of fun we canachieve)? How would the time complexity change? Show the modification of the pseu-docode, argue that your modification solves this part correctly, and explain what thenew time complexity is. 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9652667

Have any Question?


Related Questions in Computer Engineering

Show how an 8x1 multiplexer can be constructed from 4x1

Show how an 8x1 multiplexer can be constructed from 4x1 multiplexers and 2x1 multiplexers and no logic gates.

One of the basic motivations behind the minimum spanning

One of the basic motivations behind the Minimum Spanning Tree Problem is the goal of designing a spanning network for a set of nodes with minimum total cost. Here we explore another type of objective: designing a spannin ...

You are required to carry out an analysis of the it

You are required to carry out an analysis of the IT requirements of a software company and design a virtualisation solution to satisfy these requirements. You will need to produce a report outlining your design and provi ...

Identify and evaluate at least three considerations that

Identify and evaluate at least three considerations that one must plan for when designing a database. Suggest at least two types of databases that would be useful for small businesses, two types for regional level organi ...

Question suppose you have created a program that creates

Question : Suppose you have created a program that creates instances of different types of cars. Now you are creating a program that keeps track of different types of cars. Choose the abstract classes and concrete classe ...

Suppose we want to build a b tree that has space for 200000

Suppose we want to build a B+ tree that has space for 200,000 data entries in its leaf pages. Each data entry is made up of a key and its corresponding data value. Let us assume the following specifications. Each page (l ...

Sunland industries has a three-year bond outstanding that

Sunland Industries has a three-year bond outstanding that pays a 7.80 percent coupon rate and is currently priced at $938.80. What is the yield to maturity of this bond? Assume annual coupon payments.  (Round answer to 2 ...

Analyze the time complexity of the following ternary search

Analyze the time complexity of the following ternary search algorithm: identify two points that subdivide a sorted array into three parts. If the given number is equal to one of these two points, we are done. Otherwise, ...

Question suppose that a word of data is transferred from

Question : Suppose that a word of data is transferred from the main memory to the memory buffer register (MBR). However, after decoding the MBR comes to know that it is not the real data rather it is an indirection (poin ...

Assume that these data are seven random observations taken

Assume that these data are seven random observations taken from a larger population whose values are normally distributed. (even if this assumption makes little sense) Using this assumption, coupled with prior computatio ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As