CH. 9

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

None of these

Which sorting algorithm moves elements to their final sorted position in the array?

Selection

What does the variable middle represent in a binary search algorithm?

Subscript of the midpoint

To order an array of strings in alphabetic order, the sorting algorithm should be structured for ________ order.

ascending

Computer programming languages are only able to perform sort algorithms on numeric arrays.

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.

False

The bubble sort is limited to arranging data only in acceding order.

False

The sequential search algorithm is simple and most efficient to use with a large data array.

False

Which statement is true after the execution of the following statements? Set t = x Set x = y Set y = t

x and y swapped their values

Which statement is true after the execution of the following statements? Set x = y Set y = x

x contains the value in y and y stayed the same

When the elements in an array are stored from lowest to highest, the array is sorted in ________ order.

Ascending

Which of the following search algorithms should be used on large arrays if speed is important?

Binary

Which search algorithm uses three variables to mark positions within the array as it searches for the searchValue?

Binary

Which searching algorithm requires the array to be ordered?

Binary

All sorting algorithms contain a group of statements that swap values in array elements.

True

In a selection sort algorithm, the variable minValue holds the smallest value found in the scanned area of the array.

True

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

Swapping the contents of two variables requires a third variable that can serve as a temporary storage location.

True

The data in an array can be sorted in either ascending or descending order.

True

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


संबंधित स्टडी सेट्स

fall 2018 maternal/newborn exam 1

View Set

Regional Economic Integration (REI)

View Set

Chapter 01 Introduction to Corporate Finance

View Set

Graphical User Interface Programming Using Java

View Set