Big theta algorithm analysis

User Generated

ESML

Computer Science

Description

prove a big theta bound for the algorithm below:

function F(n) begin

array A[1:n,1:n]

for i := 1 to n do

A[i, i] := 0

for m := 2 to n do

for i := 1 to n − m + 1 do begin

j := i + m – 1

A[i,j] := ∞
for k := i to j – 1 do

A[i, j] := min A[i, j], A[i, k] + A[k + 1, j] + ijk

end

return A[1, n]

end

Unformatted Attachment Preview

function F(n) begin array A[1:n,1:n] for i:=1 to n do A[i, i] := 0. for m:=2 to n do for i:=1 to n - m + 1 do begin j:=i+m - 1 A[i,j] :=00 for k:= i toj - 1 do A[i, j] := min A[i, j], A[i, k] + A[k + 1, j] + ijk end return A[1, n] end
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

...


Anonymous
Great! 10/10 would recommend using Studypool to help you study.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags