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
Consider the following list: int list[] = {4,8,19,25,34,39,45,48,66,75,89,95}
When performing a binary search,the target is first compared with ____.
(Multiple Choice)
4.7/5
(77)
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.7/5
(63)
With insertion sort,the variable firstOutOfOrder is initialized to ____,assuming n is the length of the list.
(Multiple Choice)
4.9/5
(82)
Let f and g be real-valued functions. Assume that f and g are nonnegative, that is, for all real numbers
and
We say that
is of g(n). written
if there exist positive constants c and
such that
For all
(Short Answer)
4.8/5
(72)
A sequential search of an n-element list takes ____ key comparisons on average to determine whether the search item is in the list.
(Multiple Choice)
4.9/5
(73)
If a list of eight elements is sorted using selection sort,the unsorted list is ____ after the second iteration.
(Multiple Choice)
4.8/5
(82)
A sequential search of an n-element list takes ____ key comparisons if the item is not in the list.
(Multiple Choice)
4.8/5
(73)
The quick sort algorithm uses the ____________________ technique to sort a list.
(Short Answer)
4.9/5
(99)
The ____________________ search algorithm is the optimal worst-case algorithm for solving search problems by using the comparison method.
(Short Answer)
4.8/5
(79)
The behavior of merge sort is ____ in the worst case and ____ in the average case.
(Multiple Choice)
4.8/5
(76)
The top node of a comparison tree is call the ____________________ node.
(Short Answer)
4.8/5
(91)
When working with the unsorted portion of a list,the second step in a selection sort is to ____.
(Multiple Choice)
4.9/5
(97)
For a list of length n,the bubble sort makes exactly ____________________ key comparisons.
(Short Answer)
4.9/5
(84)
The behavior of quick sort is ____ in the worst case and ____ in the average case.
(Multiple Choice)
4.8/5
(72)
For a list of length n,insertion sort makes ____ key comparisons,in the worst case.
(Multiple Choice)
4.9/5
(73)
During the sorting phase of insertion sort,the array containing the list is divided into two sublists,sorted and unsorted.
(True/False)
4.9/5
(88)
When moving array values for insertion sort,to move list[4] into list[2],first ____.
(Multiple Choice)
4.9/5
(92)
Which of the following correctly states the quick sort algorithm?
(Multiple Choice)
4.8/5
(62)
Suppose that L is a sorted list of size 1024,and we want to determine whether an item x is in L.From the binary search algorithm,it follows that every iteration of the while loop cuts the size of the search list by half.
(True/False)
5.0/5
(80)
Consider the following list: int list[] = {4,8,19,25,34,39,45,48,66,75,89,95}
When performing a binary search for 75,after the first comparison,the search is restricted to ____.
(Multiple Choice)
4.9/5
(82)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)