Question: Task 4 . In order to handle the case that no existing indices a & b can reduce the number of breakpoints, we need to
Task In order to handle the case that no existing indices a & b can reduce the number of breakpoints, we need to reverse an increasing strip. We need implement the following function:
findincreasingstripdatafunction implementation
Under an assumption that the entire sequence is composed of increasing strips, you are to identify the indices a and b that define the second of those strips that is the one after that which starts with For example, a call to
findincreasingstrip
should return the index pair because those indices identify the extent of the strip holding values
Note: This function is only triggered in a special case when there is no way to do a reversal that fixes a breakpoint which implies that there are no decreasing strips Since we pick random shuffles by default, it may be that some execution of the program trigger this function, while others do not. So you might get lucky and solve the problem even before implementing this function properly. But you should test on some cases that do trigger this function.
def findincreasingstripdata: Return ab defining the second increasing strip presuming there are two or more such strips
Test your function in the following examples:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
