Question: design a dynamic programming algorithm to calculate the optimal number of breaks (the minimum number of breaks needed) There is a chocolate bar consisting of
There is a chocolate bar consisting of an nxm rectangular grid of squares. some of the squares have raisins in them, and you hate raisins. you would like to break the chocolate bar into pieces so as to separate all the squares with raisins, from all the squares with no raisins. at any time a break separates a piece into two new pieces along a row or a column. Below are 2 example chocolate bars, and possible steps to break them up. Example 1 RR R RR R RR RR R T R R R RR RR R RR RR R RR RR RR R R R R R R Example 2a R R R R RRRR R R R RRRR = RRR Example 2b R R R R R R R R T R R R T R RRRR RRRR RRRR
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
