Exam 9: Sorting and Searching Arrays

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following sorting algorithms is the least efficient?

Free
(Multiple Choice)
4.8/5
(24)
Correct Answer:
Verified

A

For an array of n items,the average number of comparisons in a sequential search is _______.

Free
(Short Answer)
4.9/5
(40)
Correct Answer:
Verified

n/2

In the bubble sort algorithm,the maxElement variable will hold the _______ of the last element that is to be compared to its immediate neighbor.

Free
(Short Answer)
4.8/5
(42)
Correct Answer:
Verified

subscript

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

(True/False)
4.8/5
(29)

The advantage of the _________ search is its simplicity.

(Short Answer)
4.8/5
(36)

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

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.9/5
(37)

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

(Multiple Choice)
4.7/5
(37)

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)
4.7/5
(33)

In a sorting algorithm,the sort order can be changed by changing the ________________ operator.

(Short Answer)
4.8/5
(29)

In a binary search,what is the maximum number of comparisons that need to be performed if the array contained 1000 elements?

(Multiple Choice)
4.9/5
(36)

When placing the elements in an array in descending order,the __________ sort begins by finding and placing the largest value in element 0.

(Short Answer)
4.9/5
(28)

Which of the following is a sorting algorithm?

(Multiple Choice)
4.8/5
(45)

When using a module to swap the values in two variables,the arguments must be passed into __________ parameters in the module.

(Short Answer)
4.8/5
(41)

Which sorting algorithm sorts the first two elements of an array before inserting the remaining elements into that sorted part of the array?

(Multiple Choice)
4.8/5
(40)

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)
4.7/5
(34)

The _________ search algorithm locates an item in an array by repeatedly dividing the array in half.

(Short Answer)
5.0/5
(34)

For an array of n items,the maximum number of comparisons in a sequential search is ______.

(Short Answer)
4.8/5
(39)

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.

(Multiple Choice)
4.9/5
(38)

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

(True/False)
4.9/5
(30)
Showing 1 - 20 of 43
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)