Question: Please choose the correct answer and explain the solution. 14. (Problem 8) Choose ALL correct statements, if more than one is correct. (10 Points) Which

Please choose the correct answer and explain the solution.

Please choose the correct answer and explain the solution. 14. (Problem 8)

14. (Problem 8) Choose ALL correct statements, if more than one is correct. (10 Points) Which of the following statements is true for a big-O estimate on the size (time complexity) of the output s based on the size of the input n for the following algorithms? 1 : procedure F(n: integer) procedure G(n: integer) procedure H(n: integer) 2 : S := 0 S := 0 S := 0 3 : for i := 1 to n do for i := 1 to 2n do for i := 1 to 3n do 4 : for j := 1 to 10 do for j := 1 to i do s :=s+ 1 5 : s :=s+ 1 S :=s+ 1 end for 6 : end for end for for j := 1 to 2n do 7 : end for end for s:=5-1 8 : return s return s end for 9 : end procedure end procedure return s 10 : end procedure (A) Algorithm Fis O(1). (B) Algorithm F is O(n). O (C) Algorithm G is O (n). [(D) Algorithm G is O(n2). (E) Algorithm His O(n). (F) Algorithm H is @(n2)

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 Mathematics Questions!