Exam 18: Searching and Sorting Algorithms
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 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 (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
After the second iteration of bubble sort for a list of length n,the last ____ elements are sorted.
Free
(Multiple Choice)
4.8/5
(35)
Correct Answer:
A
In the average case,sequential search typically searches ____.
Free
(Multiple Choice)
4.7/5
(34)
Correct Answer:
C
The sequential search algorithm does not require that the list be sorted.
Free
(True/False)
4.8/5
(47)
Correct Answer:
True
During the second iteration of a selection sort,the smallest item is moved to the top of the list.
(True/False)
4.8/5
(35)
Any sorting algorithm that sorts a list of n distinct elements by comparison of the keys only,in its worst case,makes at least ____________________ key comparisons.
(Short Answer)
4.7/5
(29)
If n = 1000,then to sort the list,selection sort makes about 50,000 key comparisons.
(True/False)
4.9/5
(32)
For a list of length n,selection sort makes ____ item assignments.
(Multiple Choice)
4.7/5
(35)
In a quick sort,all of the sorting work is done by the function ____________________.
(Short Answer)
4.8/5
(44)
The first step in the quick sort partition algorithm is to determine the ____________________ and swap it with the first element in the list.
(Short Answer)
4.9/5
(39)
The formula to find the index of the middle element of a list is ____.
(Multiple Choice)
4.9/5
(42)
____ sort requires knowing where the middle element of the list is.
(Multiple Choice)
4.8/5
(36)
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
(38)
In a bubble sort for list of length n,the first step is to compare elements ____.
(Multiple Choice)
4.9/5
(44)
The sequential search algorithm uses a(n)____ variable to track whether the item is found.
(Multiple Choice)
4.9/5
(43)
If n = 1000,to sort the list,bubble sort makes about ____ item assignments.
(Multiple Choice)
4.9/5
(41)
The selection sort algorithm finds the location of the smallest element in the unsorted portion of the list.
(True/False)
4.8/5
(38)
In the case of an unsuccessful search,it can be shown that for a list of length n,a binary search makes approximately ____________________ key comparisons.
(Short Answer)
4.9/5
(51)
We can trace the execution of a comparison-based algorithm by using a graph called a ____.
(Multiple Choice)
4.9/5
(39)
A sequence of branches in a comparison tree is called a(n)____________________.
(Short Answer)
4.8/5
(37)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)