Cutting a stick A stick n inches long needs to be cut into n 1-inch pieces. Outline an algorithm that performs this task with the minimum number of cuts if several pieces of the stick can be cut at the same time. Also give a formula for the minimum number of cuts
Cutting a stick A stick n inches long needs to be cut into n 1-inch pieces....
An open box is to be made from a rectangular piece of tin 12 inches long and 10 inches wide by cutting pieces of x-inch square from each corner and bonding up the sides. find the formula that expresses the volume of the box as a function of x.
1. a 1534 inch board is curt from a 36 14 inch board. The saw cut takes 38 inch. How much of the 36 14 inch board is left after cutting? Simplfiy your answer. type an interger simplified fraction, or mixed number. There are ___ inches left after cutting. 2. a dress is on sale for $176. what was the orginial price of the dress if the discount was 15 of the orginial price? the originial price of the dress...
5. (20 pts.) Copper Pipes Bubbles has a copper pipe of length n inches and an array of nonnegative integers that contains prices of all pieces of size smaller than n. He wants to find the maximum value he can make by cutting up the pipe and selling the pieces. For example, if length of the pipe is 8 and the values of different pieces are given as following, then the maximum obtainable value is 22 (by cutting in two...
Given an n*m chocolate bar, you need to break it into n*m 1*1 pieces. You can break a bar only in a straight line, and only one bar can be broken at a time. Design an algorithm that solves the problem with the minimum number of bar breaks. Decrease and Conquer Divide and Conquer Transform and Conquer
can you plzzz explain in detial There are n pancakes to be fried on a small grill that can hold only two pancakes at a time. Each pancakes has to be fried on both sides; frying one side of a pancakes takes 1 minute, regardless of whether one or two pancakes are fried at the same time. Consider the following recursive algorithm for executing this task in the minimum amount of time. Ifns 2, fry the pancakes or the two...
Let be a permutation of {1,2,……n}.Let -1 be the (n-1)-tuple with one element from missing. Alice shows Bob -1[i] one by one in the increasing order of i from 1 to (n-1).bob’s task is to compute the missing element from -1 that is in with very limited – O(log n) bits – of memory. Design an algorithm to compute the missing element in this memory-limited and access-limited model, i.e Alice can only show each number to Bob once, and Bob...
I need help In the lecture you got acquainted with the median algorithm, which calculates the median of an unsorted array with n∈N elements in O (n). But the algorithm can actually do much more: it is not limited to finding only the median, but can generally find the ith element with 0≤i <n. Implement this generic version of the median algorithm by creating a class selector in the ads.set2.select package and implementing the following method: /** * Returns the...
4. A certain circuit is properly fused for a 5-horsepower motor. If the motor is to be replaced by several X-horsepower motors, how many motors will the fuses be able to carry? 5. A 20-foot length of underground cable is cut into 6-inch pieces. How 6. How many whole wedges 3% inches long can be made from 20 wedge Both work 5 days per week. Over a 2-week period, how many times longer than electrician A does electrician B work,...
There are n trading posts numbered 1 to n as you travel downstream. At any trading post i you can rent a canoe to be returned at any of the downstream trading posts j, where j >= i. You are given an array R[i, j] defining the costs of a canoe which is picked up at post i and dropped off at post j, for 1 ≤ i ≤ j ≤ n. Assume that R[i,i] = 0 and that you...
6. Consider the following basic problem. You're given an array A consisting of n integers A[1], A[2], , Aln]. You'd like to output a two-dimensional n-by-n array B in which B[i, j] (for i <j) contains the sum of array entries Ali] through Aj]-that is, the sum A[i] Ai 1]+ .. +Alj]. (The value of array entry B[i. Λ is left unspecified whenever i >j, so it doesn't matter what is output for these values.) Here's a simple algorithm to...