Exam 18: Searching and Sorting Algorithms
Exam 1: An Overview of Computers and Programming Languages40 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Inputoutput40 Questions
Exam 4: Control Structures I Selection40 Questions
Exam 5: Control Structures Ii Repetition40 Questions
Exam 6: User-Defined Function41 Questions
Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types40 Questions
Exam 8: Arrays40 Questions
Exam 9: Records Structs40 Questions
Exam 10: Classes and Data Abstraction43 Questions
Exam 11: Inheritance and Composition41 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes44 Questions
Exam 13: Operator Overloading and Templates41 Questions
Exam 14: Exception Handling43 Questions
Exam 15: Recursion43 Questions
Exam 16: Linked Lists40 Questions
Exam 17: Stacks and Queue43 Questions
Exam 18: Searching and Sorting Algorithms40 Questions
Exam 19: Binary Trees43 Questions
Exam 20: Graph Algorithms48 Questions
Exam 21: Standard Template Library41 Questions
Select questions type
For a list of length n, the bubble sort makes exactly ____________________ key comparisons.
Free
(Short Answer)
4.8/5
(40)
Correct Answer:
n(n-1)/2
When working with the unsorted portion of a list, the second step in a selection sort is to ____.
Free
(Multiple Choice)
4.8/5
(28)
Correct Answer:
C
Assume that list consists of the following elements.What is the result after bubble sort completes? int list[] = {2, 56, 34, 25, 73, 46, 89, 10, 5, 16};
Free
(Multiple Choice)
4.8/5
(25)
Correct Answer:
C
A sequence of branches in a comparison tree is called a(n) ____________________.
(Short Answer)
4.7/5
(41)
The sequential search algorithm does not require that the list be sorted.
(True/False)
4.8/5
(43)
If n = 1000, to sort the list, bubble sort makes about ____ item assignments.
(Multiple Choice)
4.9/5
(37)
To construct a search algorithm of the order less than log2n, it cannot be ____________________ based.
(Short Answer)
4.8/5
(38)
In the average case, sequential search typically searches ____.
(Multiple Choice)
4.9/5
(37)
For a list of length n, selection sort makes ____ item assignments.
(Multiple Choice)
4.7/5
(33)
For a list of length n, insertion sort makes ____ key comparisons, in the worst case.
(Multiple Choice)
4.8/5
(40)
When moving array values for insertion sort, to move list[4] into list[2], first ____.
(Multiple Choice)
4.8/5
(32)
Let f be a function of n.By the term ____________________, we mean the study of the function f as n becomes larger and larger without bound.
(Short Answer)
4.9/5
(35)
We can trace the execution of a comparison-based algorithm by using a graph called a ____.
(Multiple Choice)
4.8/5
(32)
The formula to find the index of the middle element of a list is ____.
(Multiple Choice)
4.7/5
(39)
The swap function of quick sort is written differently from the swap function for selection sort.
(True/False)
4.9/5
(42)
The binary search algorithm can be written iteratively or recursively.
(True/False)
5.0/5
(39)
The behavior of merge sort is ____ in the worst case and ____ in the average case.
(Multiple Choice)
4.7/5
(34)
In a bubble sort for list of length n, the first step is to compare elements ____.
(Multiple Choice)
4.9/5
(40)
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
(36)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)