Exam 16: Searching, Sorting and the Vector Type
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the String Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
Assume that n = 1000. To sort the list, bubble sort makes about ____ item assignments.
(Multiple Choice)
4.7/5
(42)
The insertion sort algorithm sorts the list by moving each element to its proper place.
(True/False)
4.9/5
(35)
A variable declared using the vector type is called a ____.
(Multiple Choice)
4.7/5
(35)
For sorting a list of length n, bubble sort uses ____ iterations.
(Multiple Choice)
4.8/5
(32)
The type vector provides the expression ____________________, which returns the last element of the object.
(Short Answer)
4.8/5
(40)
If you initially declare a vector object and do not specify its size, then in order to add elements to the vector object, we use the function ____________________.
(Short Answer)
4.9/5
(37)
The bubble sort makes fewer item assignments than comparisons with a list of 1000 elements.
(True/False)
4.9/5
(40)
With the binary search algorithm, ____ key comparison(s) is/are made in the successful case-the last time through the loop.
(Multiple Choice)
4.9/5
(36)
If the search item is the 900th item in the list, the sequential search makes ____ key comparisons to determine whether the search item is in the list.
(Multiple Choice)
4.8/5
(32)
Which of the following statements declares intList to be a vector object of size 10?
(Multiple Choice)
5.0/5
(38)
Consider the following list: int list[] = {4, 8, 19, 25, 34, 39, 45, 48, 66, 75, 89, 95}
When performing a binary search, the element to be found is first compared with ____.
(Multiple Choice)
4.8/5
(34)
The type vector provides the expression ____________________, which returns the maximum number of elements that can be inserted into the object vecList.
(Short Answer)
4.8/5
(34)
In the insertion sort function, the variable firstOutOfOrder is initialized to ____, assuming n is the length of the list.
(Multiple Choice)
4.7/5
(31)
The statement vector<elemType>____________________; creates the vector object vecList of size n.
(Short Answer)
4.7/5
(45)
Which of the following statements declares intList to be an empty vector?
(Multiple Choice)
4.7/5
(46)
In a bubble sort, the smaller elements move toward the bottom, and the larger elements move toward the top of the list.
(True/False)
4.9/5
(31)
The type vector provides the function ____________________, which returns the first element in the vector object.
(Short Answer)
4.8/5
(34)
The size of a list is fixed and cannot be increased or decreased.
(True/False)
4.7/5
(42)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)