,6/8 17:55 CDT,Due date-->9/20/2000 10:00 CDT

Which of the following subscripts accesses the 10th array element?

1) [9] 2) [10] 3) {9} 4) {10} For x={3,4,5,6,7}, give the array reference for the fifth element.

If you pass only an array as a parameter to a procedure, how does the procedure determine the number of elements?

How many dimensions does x={{0,1}, {4}, {5,6,7}} have?

1) 0 2) 1 3) 2 4) 3 For Question 4, what does x[1] reference?

1) nil 2) {0,1} 3) {0} 4) syntax error For Question 4, what does x[1,2] reference?

1) nil 2) 1 3) 4 4) syntax error 5) 0 For Question 4, what does x[1][2] reference?

1) nil 2) 1 3) 4 4) syntax error 5) 0 For Question 4, what does x[2][1] reference?

1) nil 2) 1 3) 4 4) syntax error 5) 0 Can the bounds of an array be increased at runtime

1) yes 2) no How can you parameterize array creation so that the entire program can adapt to different problem sizes?

How would you improve the following code?

result=liters*3.0865;Can the same array store more than one element data type?

1) yes 2) no For Question 4, check all the legal subscript references.

1) x[3] 2) x[x[1]] 3) x[6.7] 4) x[true] 5) x["6"] All arrays are passed to procedures

1) by value 2) by reference void p(int x[]){cout<<x[2];};

void main(){

int x[10],i;

for (i=0;i<10;i++)x[i]=i+1;

p(x);

};

What prints?1) 1 2) 2 3) 3 4) 4 How many rows does

**x**have?How many columns does

**x**have?How many initialized elements does

**x**have?What is the subscript of the first element?

Write a single statement that sets each element in the second row to 6.

In the worst case, searching a 40-element, unordered, integer array for a matching value takes how many comparisons?

1) 80 2) 20 3) 40 4) 33 In the best case, searching a 40-element, unordered, integer array for a matching value takes how many comparisons?

1) 13 2) 20 3) 10 4) 1 In the worst case, searching a 64-element, sorted, integer array for a matching value takes how many comparisons?

1) 6 2) 12 3) 64 4) 32 Sort the sequence 23 7 9 11 2 18 56 4 into ascending order by hand.

Using a binary search for 7 in the sorted sequence 1 2 3 4 5 6 7 8 9, which element index is compared first?

1) 1 2) 9 3) 5 4) 0 5) 6 Using a binary search for 7 in the sorted sequence 1 2 3 4 5 6 7 8 9, which element index is compared second?

1) 1 2) 9 3) 4 4) 0 5) 7 Using Interchange Sort, determine the state of the sequence 23 7 9 11 2 18 56 4 after the first pass through the array.

Using Interchange Sort, determine the state of the sequence 23 7 9 11 2 18 56 4 after the second pass through the array.