40 questions
1.Employee records stored in order from highest-paid to lowest-paid have been sorted in_____________order.
a. recursive
b. ascending
c. staggered
d. descending
2.Student records stored in alphabetical order by last name have been sorted in_____________order.
a. recursive
b.ascending
c. staggered
d. descending
3.When computers sort data,they always_____________order.
a. place items in ascending order
b. use a bubble sort
c. use numeric values when making comparisons
d. begin the process by locating the position of the lowest value
4. Which of the following code segments correctly wasps the players of variables named x and y?
a. x = y, y = temp, x = temp
b. temp = x, x = y, y = temp
c. x = y , temp = x, y = temp
d. temp = x, y = x, y = temp
5. Which type of sort compares list items in pairs, swapping any two adjacent values that are out of order?
a. insertion sort
b. indexed sort
c. bubble sort
d. selection sort
6. To sort a lost 15 values using a bubble sort, the great number of times you would have to pass through the list making comparisons is_____________
a. 12
b. 13
c. 14
d. 15
7. To completely sort a lost of eight values using a bubble sort, the greatest possible number of required pair comparisons is_____________.
a. seven
b. eight
c.49
d.64
8.When you do not know how many times need to be sorted in a program, you can create an array that has_______________.
a. variable-sized elements
b. at least as many elements as the number you predict you will need
c.at least one element less than the number you predict you will need
d.You cannot sort items if you do not know the number of items when you write the program.
9. In a bubble order, on each pass through the list that must be sorted, you can stop making pair comparison______________.
a. one comparison sooner
b. two comparisons sooner
c. one comparison later
d. two comparisons later
10. When performing a bubble sort on a list of 10 values, you can stop making passes through the list of values as soon as___________on a single pass through the list.
a. no swaps are made
b. exactly one swap is made
c. no more than nine swaps are made
d. no more than 10 swaps are made
11. The bubble sort is_________.
a. the most efficient sort
b. a relatively fast sort compared to others
c. a relatively easy sort to understand
d. all of the above
12. Data stored in a table that can be accessed using row and column number is stores as a________array.
a. single-dimensional
b. two -dimensional
c. three-dimensional
d. non-dimensional
13. A two-dimensional array declared as num my Array[6] [7] has__________columns.
a. 5
b. 6
c. 7
d. 8
14. In a two-dimensional array declared as num myArray [6][7], the highest row number is _______.
a. 5
b. 6
c. 7
d. 8
15. If you access a two-dimensional array with the expression output myArray [2][5], the output value while be__________.
a. 0
b. 2
c. 5
d. impossible to tell from the information given
16. Three-dimensional arrays
a. are supported in many modern programming languages
b. always contain at least nine elements
c. are used only in object-oriented languages
d. all of the above
17. Students records are stored in ID number only, but accessed by grade-point average for a report. Grade-point average is a(n) ___________order
a. imaginary
b. physical
c. logical
d. illogical
18. When you store a list of key fields paired with the storage address from the corresponding data record, you are creating___________.
a. a directory
b. a three-dimensional array
c. a linked list
d. an index
19. When a record in a indexed file is not needed for further processing,_____________.
a. its first character must be replaced with a special character, indicating it is a deleted record
b. its position must be retained, but its fields must be replaced with blanks
c. it must be physically removed from the file
d. the record can stay in place physically, but its reference is removed from the index
20.With a linked list, every record______________.
a. is stored in sequential order
b. contains a field that holds the address of another record
c. contains a code that indicates the record's position in an imaginary list
d. is stored in a physical location that corresponds to a key field
Sequential order
describes the arrangement of records when they are stored one after another on the basis of the value in a particular field.
value in a list is the value in the middle position when the values are sorted; when the list contains an even number of values, the median is the mean of the values in the two middle positions.
is another name for a bubble sort.
median
value in a list is the arithmetic average.
is a list of instructions that accomplish a task.
is a list accessed using a single subscript.
mean
is a list accessed using a single subscript.
are terms used by mathematicians to describe a two-dimensional array.
value in a list is the arithmetic average.
bubble sort
value in a list is the value in the middle position when the values are sorted; when the list contains an even number of values, the median is the mean of the values in the two middle positions.
is a list accessed using a single subscript.
is a sort in which a list of elements is arranged in either ascending or descending order by comparing items in pairs; when an item is out of order, it is swapped with the item below it.
sinking sort
is a sort in which each list element is examined one at a time; if an element is out of order relative to any of the items earlier in the list, each earlier item is moved down one position and then the tested element is inserted.
is another name for a bubble sort.
is a sort in which a list of elements is arranged in either ascending or descending order by comparing items in pairs; when an item is out of order, it is swapped with the item below it.
algorithm
is a list accessed using a single subscript.
are terms used by mathematicians to describe a two-dimensional array.
is a list of instructions that accomplish a task.
swap values
is to exchange the values of two variables.
is a list accessed using a single subscript.
is the order in which its elements are actually stored.
insertion sort
is the order in which its elements are actually stored.
of a record contains a value that makes the record unique among all records in a file.
is a sort in which each list element is examined one at a time; if an element is out of order relative to any of the items earlier in the list, each earlier item is moved down one position and then the tested element is inserted.
one-dimensional or single-dimensional array
are terms used by mathematicians to describe a two-dimensional array.
of a record contains a value that makes the record unique among all records in a file.
is a list accessed using a single subscript.
two-dimensional arrays
have both rows and columns of values; you must use two subscripts when you access an element in a two-dimensional array.
are arrays in which each element is accessed using three subscripts.
are lists with more than one dimension.
matrix and table
is the order in which its elements are actually stored.
are arrays in which each element is accessed using three subscripts.
are terms used by mathematicians to describe a two-dimensional array.
three -dimensional arrays
identify computer memory and storage locations.
are arrays in which each element is accessed using three subscripts.
such as a disk, is one from which records can be accessed in any order.
multidimensional arrays
is the order in which it is used, even though its elements are not necessarily stored in that physical order.
identify computer memory and storage locations.
are lists with more than one dimension.
physical order
of a record contains a value that makes the record unique among all records in a file.
is the order in which its elements are actually stored.
contains an extra field in every record of stored data; this extra field holds the physical address of the next logical record.
logical order
identify computer memory and storage locations.
is the order in which it is used, even though its elements are not necessarily stored in that physical order.
such as a disk, is one from which records can be accessed in any order.
key field
of a record contains a value that makes the record unique among all records in a file.
contains an extra field in every record of stored data; this extra field holds the physical address of the next logical record.
describes the arrangement of records when they are stored one after another on the basis of the value in a particular field.
addresses
is a sort in which each list element is examined one at a time; if an element is out of order relative to any of the items earlier in the list, each earlier item is moved down one position and then the tested element is inserted.
value in a list is the arithmetic average.
identify computer memory and storage locations.
When you index
records, you store a list of key fields paired with the storage address for the corresponding data record.
is a sort in which a list of elements is arranged in either ascending or descending order by comparing items in pairs; when an item is out of order, it is swapped with the item below it.
are terms used by mathematicians to describe a two-dimensional array.
random-access storage device
have both rows and columns of values; you must use two subscripts when you access an element in a two-dimensional array.
records, you store a list of key fields paired with the storage address for the corresponding data record.
such as a disk, is one from which records can be accessed in any order.
linked list
describes the arrangement of records when they are stored one after another on the basis of the value in a particular field.
contains an extra field in every record of stored data; this extra field holds the physical address of the next logical record.
records, you store a list of key fields paired with the storage address for the corresponding data record.