Exam 8: Searching and Sorting Arrays

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

A binary search begins with the __________ element of an array.

(Multiple Choice)
4.7/5
(36)

Regardless of the algorithm being used, a search through an array is always performed

(Multiple Choice)
4.7/5
(41)

The following is the pseudocode for which type of algorithm? Set found to False Set position to -1 Set index to 0 While found is False and index < number of elements If list[index] is equal to search value Found = true Position = index End If Add 1 to index End While Return position

(Multiple Choice)
4.8/5
(35)

You are more likely to find an item by using a binary search than by using a linear search.

(True/False)
4.8/5
(35)

A selection sort and a binary search can be applied to STL vectors as well as arrays.

(True/False)
4.8/5
(35)

What is the output after the following code executes? Int numerator = 5; Int denominator = 25; Int temp = 0; Temp = numerator; Numerator = denominator; Denominator = temp; Cout << numerator << "/" << denominator << " = " << (numerator/denominator) << endl;

(Multiple Choice)
4.7/5
(34)

Data that is to be sorted in ascending order is ordered

(Multiple Choice)
4.9/5
(35)

Using a linear search to find a value that is stored in the last element of an array that contains 20,000 elements, __________ elements must be compared.

(Multiple Choice)
4.7/5
(40)

If you are using the bubble sort algorithm to sort an array in descending order, the smaller values move toward the end.

(True/False)
4.9/5
(42)

The linear search repeatedly divides the portion of an array being searched in half.

(True/False)
4.9/5
(40)
Showing 21 - 30 of 30
close modal

Filters

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