Answer the following questions true (T) or false (F)

1. Given the two C++ array declarations:
int a[10], b[10];
You can successfully compute one array, say a, then assign b to a:
a = b;

2. In the sequential search algorithm, items are examined alternately, odd then evens, in order to find whether the target value is in the array (and if the target is present, to the index of the target.)

1. False
Explanation: You cannot assign arrays in C++. Some compilers allow this, but the Standard says this is illegal, and most compilers do not allow it. To do this you need to write a loop or otherwise copy individual indexed variables.
2. False
Explanation: The sequential search algorithm performs just as the name suggests: The elements are searched in sequential order, until the target is found (success) or the end of the array is found (failure).

Computer Science & Information Technology

You might also like to view...

When using the background property, the ________ value of the repeat attribute will cause an image to display only one time

Fill in the blank(s) with correct word

Computer Science & Information Technology

Section 207, Title II of the U.S. Patriot Act expanded the duration of FISA surveillance of non-U.S. persons from 45 to 90 days

Indicate whether the statement is true or false.

Computer Science & Information Technology