1. Engineering
  2. Computer Science
  3. question 2 10 select the best answer examine the following...

Question: question 2 10 select the best answer examine the following...

Question details

Question 2 10 Select the best answer. Examine the following pseudocode. Each line is numbered (leftmost number). We are interested in the number of additions performed. Line 3 performs additions. Procedure(A) 1: n# А.length 3: for j 1 to n 4: if (a<A[j]) aAl3] 6: return (a) O n+1 O n+2 O None of these answers

Question 4 10 Select the best answer. Examine the following pseudocode. Each line is numbered (leftmost number). We are interested in the number of additions performed. Line 3 performs additions. Procedure(A) 1: ne A.length 2: a al1] 3: for j 2 to n- 4: if (a A1) 6: return(a) O n+1 O n O n-2 O n-1

Question6 10 p Select the best answer. Examine the following pseudocode. Each line is numbered (leftmost number). This algorithm must find the smallest number in Sequence A. This algorithm may be flawed. If itis flawed, indicate the line that makes it incorrect (select the option that describes best what is wrong with it), otherwise select correct Procedure(A) 1: n- A.length 2: a a[n] 3: for 1 to n 4: if ( AJ) 5: 6: return(a) a AL3 O Line 3 O Line 4 O Multiple lines O Correct O Line 2

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution