Exam 10: Sorting Algorithms
Exam 1: Software Engineering Principles and C++ Classes42 Questions
Exam 2: Object-Oriented Design OOD and C++35 Questions
Exam 3: Pointers and Array-Based Lists45 Questions
Exam 4: Standard Template Library (STL) I47 Questions
Exam 5: Linked Lists44 Questions
Exam 6: Recursion36 Questions
Exam 7: Stacks44 Questions
Exam 8: Queues48 Questions
Exam 9: Searching and Hashing Algorithms49 Questions
Exam 10: Sorting Algorithms47 Questions
Exam 11: Binary Trees and B-Trees47 Questions
Exam 12: Graphs43 Questions
Exam 13: Standard Template Library (STL) II50 Questions
Select questions type
In a ____ queue, customers or jobs with higher priorities are pushed to the front of the queue.
Free
(Multiple Choice)
4.9/5
(38)
Correct Answer:
C
Mergesort uses the divide-and-conquer technique to sort a list.
Free
(True/False)
4.9/5
(39)
Correct Answer:
True
In mergesort, all the comparisons are made in the method____, which merges two sorted sublists.
(Multiple Choice)
4.8/5
(39)
A ____ is a list in which each element contains a key, such that the key in the element at position k in the list is at least as large as the key in the element at position 2k + 1 (if it exists) and 2k + 2 (if it exists).
(Multiple Choice)
4.7/5
(32)
Selection sort involves the following steps in the unsorted portion of the list: find the location of the smallest element and move the smallest element to the beginning of the unsorted list.
(True/False)
4.8/5
(35)
To divide the list into two sublists, we need to find the ____ node of the list.
(Multiple Choice)
4.9/5
(32)
In a(n) ____, a list is sorted by selecting elements in the list, one at a time, and moving them to their proper positions.
(Multiple Choice)
4.9/5
(39)
In a selection sort, the first step we locate the smallest item in the entire list, the second step we locate the smallest item in the list starting from the second element in the list, and so on.
(True/False)
4.8/5
(39)
When sorting a list, the smallest item must be moved to position 0.
(True/False)
5.0/5
(36)
To ensure that the largest element of the priority queue is always the first element of the queue, we can implement priority queues as ____.
(Multiple Choice)
4.9/5
(29)
Once the sublists are sorted, the next step in mergesort is to merge the sorted sublists.
(True/False)
4.8/5
(35)
A sequential search assumes that the data is in a particular order.
(True/False)
4.9/5
(42)
In quicksort, all the sorting work is done in ____ the list.
(Multiple Choice)
4.8/5
(32)
Initially, in a selection sort we consider that the entire list is unsorted.
(True/False)
4.9/5
(43)
In heapsort, after we convert the array into a heap, the ____ phase begins.
(Multiple Choice)
4.7/5
(42)
Inserting the new element in the first available position in the list ensures that the array holding the list is a complete ____.
(Multiple Choice)
4.9/5
(39)
In a selection sort, we find the largest item in the list first.
(True/False)
4.8/5
(49)
Showing 1 - 20 of 47
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)