Reference no: EM1378351
Algorithm Analysis with Advanced Data Structures
Alchemy
-Mines of Oreland yield unlimited amounts of silver, but no gold. Unfortunately, rich noblemen from the neighboring kingdom of Eldorado are interested only in buying gold.
-The resourceful merchants of Oreland want to hire alchemists to change the silver into gold. However, the skills of alchemists are somewhat limited - they cannot transmute any metal into any other, so the process of changing silver into gold may have to go through a sequence of transmutations involving other metals.
-For each transmutation, alchemists charge a fee, which depends on the pairs of metals involved in the transmutation.
-Your task is to write a program to help the merchants devise a sequence of transmutations that would change silver into gold with the smallest possible total fee paid to the alchemists.
Details
-Your program should read input from System.in:
-in the first line of input: a number of transmutations alchemists know how to handle
-for each transmutation the alchemists know: the metals it involves and its cost, as a triple, each in a separate line of input:
MetalX MetalY CostXY where:
-MetalX is the atomic number of the input (substrate) metal
-MetalY is the atomic number of the output (product) metal
-CostXY is the fee alchemists charge for transmuting 1 pound of MetalX into 1 pound of MetalY
-Your task is to find the sequence of transmutations, starting with silver (Ag, atomic number 47) and ending with gold (Au, atomic number 79), that has the smallest sum of fees for transmuting 1 pound of Ag into 1 pound of Au
-Your program should just return on System.out one number: the smallest possible sum of fees (it should not return the actual sequence)
-There will always be at least one way to change silver into gold
-Correct output: 9
Example
-Input:
10
47 28 5
28 29 3
26 79 6
28 26 2
79 26 4
28 79 9
26 47 7
29 28 2
47 29 10
29 79 1
-The sequence behind this correct output is (but your program shouldn't print it): 47,28,29,79 (that is: silver, nickel, copper, gold)
Provide example of next process customer
: For each of the worker positions given below give an example of the next process consumer. Also provide an example in which the listed worker would be the next process consumer:
|
Calculate cost of equity using capm
: Calculate cost of equity using CAPM. Use the rate on the 30-year T-bill for the risk free. Use 5.2% for the market risk premium - Calculate the intrinsic value of the stock using the one-stage dividend growth model
|
Question about negotiation
: There is a made up meeting in Samuel Adams Peyton Randolph, John Randolph and Lord Dunmore John Murray to debate the ramifications of independance of the colonies from Great Britian.
|
Solving problem with telling everything she knows
: Kate is a wonderful accountant and she just has a difficulty with telling "everything she knows." You discovered this out quite by accident.
|
Algorithm analysis with advanced data structures
: Write a program to help the merchants devise a sequence of transmutations that would change silver into gold with the smallest possible total fee paid to the alchemists.
|
The representativeness heuristic
: Your department was just given a new assignment to pilot and rollout to your company. The assignment involves assembling a cross-organizational team that will be given the responsibility for analyzing different payroll systems that Faraday Enterprise..
|
Question about random numbers for simulation
: The number of cars reaching at Joe Kelly's oil change and tune up place during the last two hundred hours of operation is observed to be the following:
|
Model the expression for total revenue
: The relationship d= 5000-25p explains what happens to demand as price varies. Here, price can vary between $10 and $50.
|
Woman affect the reader''s overall impression of willy
: Is Willy a likeable character? What words and actions--both Willy's and those of other characters--help the reader form this conclusion and how does the existence of The Woman affect the reader's overall impression of Willy? What does she reveal a..
|