Computer Science 1050-Ch. 6 Notes (Arrays)
symbolic constant
#define SIZE 10 defines a _____ SIZE whose value is 10.
hexidecimal
(base 16) 0-9 and A-F
binary search
1 Billion, _____ on average 30 searches.
linear search
1 Billion, _____ on average 500,000,000 searches
static
A _____ local variable exists for the duration of the program, but is visible only in the function body.
multiple-subscripted arrays
A common use of ______ is to represent tables of values consisting of information arranged in rows and columns.
null operator
All strings in C end with ______.
by value
Although entire arrays are passed by reference, individual array elements are passed ____ exactly as simple variables are.
static
Arrays and structures are ____ entities in that they remain the same size throughout program execution.
only one position
Because of the way the successive comparisons are made, a large value may move down the array many positions on a single pass, but a small value may move up _______.
by reference
C automatically passes arrays to functions ______--the called functions can modify the element values in the callers' original arrays.
binary search
If the array is sorted, the high-speed ______ technique can be used.
the number of elements in the initializer list
If the array size is omitted from a definition with an initializer list, the number of elements in the array will be ______. Ex: int n[] = {1, 2, 3, 4, 5} would create a five-element array
zero
If there are fewer initializers than elements in the array, the remaining elements are initialized to ______.
outside of the bounds
If you try and get a number OUTSIDE the array, you will get a segmentation fault. You are not allowed to go in memory __________.
m-by-n array
In general, an array with m rows and n columns is called an _______.
maximum comparisons
The _____ for any array can be determined by finding the first power of 2 greater than the number of array elements.
linear search
The _____ method works well for small or unsorted arrays.
syntax error
The array definition int n[5] = {1, 2, 3, 4, 5, 6} causes a _____ because there are 6 initializers and only five array elements.
initializers
The elements of an array can also be initialized when the array is defined by following the definition with an equals sign and braces, {}, containing a comma-separated list of ______.
zeroth element
The first element in every array is the ______.
zero
The first index value of the array is ____. 12 elements go from 0 to 11.
subscript (index)
The position number contained within square brackets is more formally called a ______ ( ____ )
searching
The process of finding a particular element of an array is called _____.
capital letters
Tip: Use _____ in #define variable, easier to read.
key value
To determine whether an array contains a value that matches a certain ______.
name of the array without any brackets
To pass an array argument to a function, specify the _______
position number
To refer to a particular location or element in the array, we specify the name of the array and the ____ of the particular element in the array.
type of each element and number of elements
You specify the _____ and _____ required by each array so that the computer may reserve the appropriate amount of memory. Ex: int array[12]
string variables
______ do NOT require & in scanf function
characters + null character
a character array (string) contains number of ________
scalability
ability to modify a system. Using symbolic constants to specify array sizes makes programs more scalable.
are NOT
arrays _____ automatically initialized to zero. You must at least initialize the first element to zero for the remaining elements to be automatically zeroed.
%p
conversion specifier normally outputs addresses as hexidecimal numbers
array
data structure consisting of related data items of the same type
row
first subscript identifies the element's _____
swap
hold = a[i]; a[i] = a[i+1]; a[i+1] = hold;
\0
null character
const
prevents modification of array values in a function. The array elements become constant in the function body, and any attempt to modify an element of the array in the function body results in a compile-time error.
column
second subscript identifies the element's _____
%s
string conversion specifier
bubble sort
the smaller values gradually "bubble" their way upward to the top of the array like air bubbles rising in water, while the larger values sink to the bottom of the array.