ITP-100 Unit 3 Test Set 3 – Flashcards

Unlock all answers in this set

Unlock answers
question
Which sorting algorithm moves elements to their final sorted position in the array? a. Bubble b. Selection c. Insertion d. Hash e. None of these
answer
Selection
question
As the ________ sorting algorithm makes passes through and compares the elements of the array, certain values move toward the end of the array with each pass. a. Bubble b. Selection c. Insertion d. Hash e. None of these
answer
Bubble
question
Which sorting algorithm sorts the first two elements of an array before inserting the remaining elements into that sorted part of the array? a. Bubble b. Selection c. Insertion d. Hash e. None of these
answer
Insertion
question
Which statement is true after the execution of the following statements? Set x = y Set y = x a. x and y contain their original values b. x and y swapped their values c. x contains the value in y and y stayed the same d. y contains the value in x and x stayed the same e. None of these
answer
x contains the value in y and y stayed the same
question
Which statement is true after the execution of the following statements? Set t =x Set x = y Set y = t a. x and y contain their original values b. x and y swapped their values c. x contains the value in y and y stayed the same d. y contains the value in x and x stayed the same e. None of these
answer
x and y swapped their values
question
In an insertion sort, what order are the elements in an array placed using the following Boolean expression? a. Ascending b. Descending c. Numeric d. Alphabetic e. None of these
answer
Descending
question
In a binary search, what is the maximum number of comparisons that need to be performed if the array contains 1000 elements? a. 1000 b. 500 c. 250 d. 100 e. None of these
answer
None of these
question
To order an array of strings in alphabetic order, the sorting algorithm should be structured for ________ order. a. alphabetic b. numeric c. ascending d. descending e. None of these
answer
ascending
question
Which of the following sorting algorithms is the least efficient? a. Bubble sort b. Insertion sort c. Selection sort d. All of these e. None of these
answer
Bubble sort
question
Swapping the contents of two variables requires a third variable that can serve as a temporary storage location. True False
answer
True
question
When values in an array need to be swapped, the array and the size of the array have to be sent to the swap module. True False
answer
False
question
The data in an array can be sorted in either ascending or descending order. True False
answer
True
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New