Give a polynomial-time algorithm that takes a sequence of supply values s1, s2, . . . , sn and returns a schedule of minimum cos
t. for example, suppose r = 1, c = 10, and the sequence of values is
1 answer:
Assuming the sequence is unsorted.
Try a rudimentary proposition, do a bubble sort, that gives O(n^2) for worst and average case. It is a polynomial algorithm.
We can also do a quick sort, with worst case O(n^2) and average case O(nlogn), which is already better.
Do we need to sort everything? Not really.
What about a single pass, and store the minimum found, exchange as required, such as:
small=A(0)
for i:1, n {
if A(i)<small small: A(i)
}
return small
This is a linear algorithm, best case n, worst case 2n so O(n)
You might be interested in
Answer:
0.8686 or 86.86 %
0.2148 or 21.48 %
Step-by-step explanation:
In z table the value of z > - 1,12 is 0.1314 (value from the z point to the left of the curve ) then 1 - 01314 will be value from z point to the right
Again from z table we get for z = - 0.79 the value 0.2148 s the vale from the point up to the left tail
Answer:
The area is 72 cm².
Step-by-step explanation:
Since it is equivalent triangle
h = b
so,
b + b + b (since all sides are equal)= 36 cm
3b = 36 cm
or, b = 36/3
so, b = 12 cm
so
area of triangle = (1/2)×b×h
= (1/2)×12cm×12cm
= 6cm × 12cm
= 72 cm²
Answer:
PEMDAS, do multiplication first then, adddition, then subtraction
Step-by-step explanation:
Answer:
Hello! answer: 4/5
Step-by-step explanation:
20 ÷ 5 = 4 25 ÷ 5 = 5 that is 4/5 therefore 4/5 is the answer because we cannot reduce any further HOPE THAT HELPS!
Answer:
1.63
HOPE THIS WILL HELP..............!