Algorithm 1 evaluate(A,i,j) 1: total 0 2: for k = i, . , j do 3: total total +A[k] 4: return total Algorithm 2 subsequenceWithMaxSum_1(A) 1: n Size… | Cheap Nursing Papers

Algorithm 1 evaluate(A,i,j) 1: total 0 2: for k = i, . , j do 3: total total +A[k] 4: return total Algorithm 2 subsequenceWithMaxSum_1(A) 1: n Size…

Algorithm 1 evaluate(A,i,j)

1: total ← 0

2: for k = i, . . . , j do

3: total ← total +A[k]

4: return total

Algorithm 2 subsequenceWithMaxSum_1(A)

1: n ← Size of A

2: answer ← (0, 0)

3: for i = 0, . . . , n − 1 do

4: for j = i, . . . , n − 1 do

5: if evaluate(A,i,j) > evaluate(A,answer[0],answer[1]) then

6: answer ← (i, j)

7: return answer

How to calculate the complexity of this pseudocode? This is java btw

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp