Question: Here is the pseudocode for the divide and conquer algorithm for the maximum contiguous sum with a print statement added: function mes ( A ,
Here is the pseudocode for the divide and conquer algorithm for the maximum contiguous sum
with a print statement added:
function mes
if
return
else
Lax
Raxmes
Lhas infinity
Lhsum
for i C downto L inclusive
Lhsun Lhsun Ai
if Lhsum Lhnax
Lhnax Lhsun
end
end
Rhnax infinity
Rhsum
for to inclusive
Rhaun Rhsun Ai
if Rhsum Rhnax:
Rhnax Rhsun
end
end
Snax Lhnax Rhnax
print Lmax Smax Rnax
end if
end function
Suppose this code is run on a list of length with the following incomplete output where we've
replaced some output by variables.
a What was the original list? You do not need do know the values of the variables to answer
this.
b What are the values of the variables?
FILL IN ALL THE BLANKS
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
