Exam 8: Searching and Sorting Arrays
Exam 1: Introduction to Computers and Programming47 Questions
Exam 2: Introduction to C62 Questions
Exam 3: Expressions and Interactivity45 Questions
Exam 4: Making Decisions51 Questions
Exam 5: Loops and Files60 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays and Vectors56 Questions
Exam 8: Searching and Sorting Arrays30 Questions
Exam 9: Pointers47 Questions
Exam 10: Characters, C-Strings, and More About the String Class47 Questions
Exam 11: Structured Data46 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes54 Questions
Exam 14: More About Classes46 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions43 Questions
Exam 16: Exceptions and Templates36 Questions
Exam 17: The Standard Template Library38 Questions
Exam 18: Linked Lists41 Questions
Exam 19: Stacks and Queues47 Questions
Exam 20: Recursion27 Questions
Exam 21: Binary Trees39 Questions
Select questions type
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)