There are service_nodes of different micro-services in a system with bidirectional connections in the form of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
There are service_nodes of different micro-services in a system with bidirectional connections in the form of a tree, where the th edge connects the micro-services service_from[i] and service_to[i]. Each micro-service is configured with a maximum number of live threads that can be present in its lifecycle, where the ith micro-service can have a maximum of threads[i] threads. The micro-services adjacent to each other must have maximum threads differing by exactly 1. Some configurations. were lost, and only k of the micro-services are known. This information is given as a 2D array, currentValues, of size kx 2 denoting [micro-service index, maximum threads], or, [i, threads[i]]. Find the maximum number of live threads that each micro-service can have such that the total number of live threads in the system is the minimum possible. Return an array of length service_nodes where the th element denotes the maximum number of live threads for the ith micro- service. Note: It is guaranteed that the solution always exists. Example Given service_nodes = 5, service_from = [1, 2, 3, 4], service_to=[2, 3, 4, 5], k =2, currentValues = [[1, 3], [5, 3]] 1:3 2 3 5:3 There are service_nodes of different micro-services in a system with bidirectional connections in the form of a tree, where the th edge connects the micro-services service_from[i] and service_to[i]. Each micro-service is configured with a maximum number of live threads that can be present in its lifecycle, where the ith micro-service can have a maximum of threads[i] threads. The micro-services adjacent to each other must have maximum threads differing by exactly 1. Some configurations. were lost, and only k of the micro-services are known. This information is given as a 2D array, currentValues, of size kx 2 denoting [micro-service index, maximum threads], or, [i, threads[i]]. Find the maximum number of live threads that each micro-service can have such that the total number of live threads in the system is the minimum possible. Return an array of length service_nodes where the th element denotes the maximum number of live threads for the ith micro- service. Note: It is guaranteed that the solution always exists. Example Given service_nodes = 5, service_from = [1, 2, 3, 4], service_to=[2, 3, 4, 5], k =2, currentValues = [[1, 3], [5, 3]] 1:3 2 3 5:3
Expert Answer:
Answer rating: 100% (QA)
To find the maximum number of live threads such that the total number of live threads in the system ... View the full answer
Related Book For
Posted Date:
Students also viewed these operating system questions
-
a. Example 13-1: Batch Reactor with an Exothermic Reaction Wolfram 1. Adiabatic Case: Use Wolfram to see whether you can find a trajectory that is ready to ignite and whose trajectory looks like a...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Using the DJIA data in Problem 5-39, use exponential smooth with trend adjustment to forecast the opening DJIA value for 2014. Use α = 0.8 and β = 0.2. Compare the MSE for...
-
Wood Design Company distributes hardwood products to small furniture manufacturers, The adjusted trial balance data given below is from the firm's worksheet for the year ended December 31,2013,...
-
Capital costs for a defender are higher than the operating costs, and the annual operating costs are gradually increasing. Capital costs for a defender are less than the operating costs, and the...
-
Why is monitoring and information disclosure critical for the success of emissions banking and trading?
-
The trial balance of Roman Company at the end of its fiscal year, August 31, 2014, includes these accounts: Inventory $17,200; Purchases $149,000; Sales Revenue $190,000; Freight-In $5,000; Sales...
-
1. Which has a bigger effect on companies' decisions to pursue opportunities in international trade, fixed costs or variable costs? Why? (Hint: I love graphs).
-
Damon Manufacturing is preparing its master budget for the first quarter of the upcoming year. The following data pertain to Damon Manufacturing's operations: Current Assets as of December 31 (prior...
-
Sunshine Airlines recently reported $7,850,00 of sales, $3,350,000 of operating costs other than depreciation, and $1,125,000 of depreciation. The company had $1,000,000 of outstanding bonds that...
-
Which category of structures is concerned with how the software is partitioned into implementation units ?
-
Bold sider the following recursive function: int sum (int n) { if (n = 1) return 1; else. return n + sum (n - 1); } Assume that the function is called using the following statement: int result sum...
-
You purchase equipment for $154,431. The company's marginal tax rate is 21%. Three-, five- and seven-year MACRS schedules: Year 3-Year 5-Year 7-Year 1 33.33% 20.00% 14.29% 2 44.45% 32.00% 24.49% 3...
-
Instructions: Prepare one 2022 Income Tax and Benefit return for each of the following taxpayers (married couple) using ProFile software. Show all of your work (and any calculations performed) in a...
-
The following financial statements are for Microsoft, Inc. FY2023 and FY2022. Calculate the cash flows from operations as it would appear on the FY2023 statement of cash flows. (Hint: include all...
-
The following bread recipe is taken from the classic cookbook The Joy of Cooking by Irma Rombauer. WHITE BREAD Wrote Louis Untermeyer: "Why has cur poetry eschewed The rapture and response of food!...
-
AB CORPORATION ISSUED THE FOLLOWING 850 COMMON STOCKS PAR VALUE P100 750 PARTICIPATING PREFERRED STOCKS PAR VALUE P100 AT 3% AB CORPORATION DECLARED P100,000.00 DIVIDEND IN 2022.
-
In Fig. 12-5, a flag, found, is used to tell whether the PID was located. Would it b possible to forget about found and just test p at the end of the loop to see whether it got to the end or not?
-
Some UNIX systems are tickless, meaning they do not have periodic clock interrupts. Why is this done? Also, does ticklessness make sense on a computer (such as an embedded system) running only one...
-
DNS names have a hierarchical structure, such as sales.general-widget.com. or cs.uni.edu One way to maintain the DNS database would be as one centralized database, but that is not done because it...
-
The post-closing trial balance for Cortez Co. is as follows. The subsidiary ledgers contain the following information: (1) accounts receivable J. Anders \($2,500,\) E Cone \($7,500,\) T. Dudley...
-
Presented below are the purchases and cash oe journals for Reyes Co. for its first month of operations. In addition, the following transactions have not been journalized for July. The cost of all...
-
Presented below are the sales and cash receipts journals for Wyrick Co. for its first month of operations. In addition, the following transactions have not been journalized for February 2008....
Study smarter with the SolutionInn App