Question: Let X[1..n] be a binary array. A 1-burst is a substring of consecutive 1s (in X) such that there is a 0 on each end

Let X[1..n] be a binary array. A 1-burst is a substring of consecutive 1s (in X) such that there is a 0 on each end of the string (or the substring reaches one end of X). For example, if X = 0110111010111101 then X has five 1-bursts (the underlined strings): 0110111010111101. If X = 11111, then if X has one 1-burst (the entire string). a) Give a recursive algorithm (in pseudo code) that computes the position and length of the longest 1-burst in X. (Your algorithm should split the input into two halves.) b) Give and analyze (time complexity) a non-recursive algorithm for the same problem

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!