Title: Module 10 Quiz (Ungraded)
Course: COP 1510 Programming Concepts > Section: Module 10 - Sorting and Searching Arrays

Q: Which of the following sorting algorithms is the least efficient?
- Bubble sort
- Insertion sort
- Selection sort
- All of these
- None of these
A: Bubble sort

Q: Which of the following search algorithms should be used on large arrays if speed is important?
- Binary
- Sequential
- Bubble
- Selection
- Insertion
A: Binary

Q: In the swap module, the third variable is declared as a ________ variable.
- Global
- Reference
- Local
- Constant
- None of these
A: Local

Q: Which statement is true after the execution of the following statements?
- x and y contain their original values
- x and y swapped their values
- x contains the value in y and y stayed the same
- y contains the value in x and x stayed the same
- None of these
A: x and y swapped their values

Q: What does the variable middle represent in a binary search algorithm?
- Subscript of the midpoint
- Middle value in the array
- Middle value in the portion to be searched
- The average of two values
- None of these
A: Subscript of the midpoint

Q: In an insertion sort, what order are the elements in an array placed using the following Boolean expression?
- Ascending
- Descending
- Numeric
- Alphabetic
- None of these
A: Descending

Q: In a selection sort, which variable holds the subscript of the element with the smallest value found in the scanned area of the array?
- minIndex
- minValue
- startScan
- SIZE
- None of these
A: minIndex

Q: In a binary search, what is the maximum number of comparisons that need to be performed if the array contains 1000 elements?
- 1000
- 500
- 250
- 100
- None of these
A: None of these

Q: Which of the following is a sorting algorithm?
- Bubble sort
- Selection sort
- Insertion sort
- All of these
- None of these
A: All of these

Q: To order an array of strings in alphabetic order, the sorting algorithm should be structured for ________ order.
- alphabetic
- numeric
- ascending
- descending
- None of these
A: ascending

Q: When the elements in an array are stored from lowest to highest, the array is sorted in ________ order.
- Ascending
- Descending
- Numeric
- Alphabetic
- None of these
A: Ascending

Q: Which sorting algorithm moves elements to their final sorted position in the array?
- Bubble
- Selection
- Insertion
- Hash
- None of these
A: Selection

Q: Which searching algorithm requires the array to be ordered?
- Sequential
- Binary
- Linear
- Parallel
- None of these
A: Binary

Q: 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.
- Bubble
- Selection
- Insertion
- Hash
- None of these
A: Bubble

Q: Which search algorithm uses three variables to mark positions within the array as it searches for the searchValue?
- Sequential
- Binary
- Parallel
- Linear
- None of these
A: Binary

Q: True/False: In a binary search, if the search fails to find the item on the first attempt, then there are 999 elements left to search in an array of 1000 elements.
- True
- False
A: False

Q: True/False: 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
A: False

Q: True/False: In a sequential search, each element is compared to the searchValue and the search stops when the value is found or the end of the array is encountered.
- True
- False
A: True

Q: True/False: The swap module is executed with three arguments to correctly swap the elements in an array.
- True
- False
A: False

Q: True/False: In a selection sort algorithm, the variable minValue holds the smallest value found in the scanned area of the array.
- True
- False
A: True