Exam 3: The Efficiency of Algorithms
Exam 1: An Introduction to Computer Science50 Questions
Exam 2: Algorithm Discovery and Design50 Questions
Exam 3: The Efficiency of Algorithms50 Questions
Exam 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates50 Questions
Exam 5: Computer Systems Organization50 Questions
Exam 6: An Introduction to System Software and Virtual Machines50 Questions
Exam 7: Computer Networks, The Internet, and the World Wide Web50 Questions
Exam 8: Information Security50 Questions
Exam 9: Introduction to High-Level Language Programming50 Questions
Exam 10: The Tower of Babel50 Questions
Exam 11: Compilers and Language Translation50 Questions
Exam 12: Models of Computation49 Questions
Exam 13: Simulation and Modeling50 Questions
Exam 14: Electronic Commerce and Databases50 Questions
Exam 15: Artificial Intelligence50 Questions
Exam 16: Computer Graphics and Entertainment: Movies, Games, and Virtual Communities50 Questions
Exam 17: Making Decisions About Computers, Information, and Society50 Questions
Select questions type
Sequential search is an order-n algorithm in the average case.
Free
(True/False)
4.8/5
(34)
Correct Answer:
True
Given the data cleanup problem described in the text, write the pseudocode for the converging-pointers algorithm for data cleanup.
Free
(Essay)
4.8/5
(34)
Correct Answer:
1. Get values for n and the n data items
2. Set the value of legit to n
3. Set the value of left to 1
4. Set the value of right to n
5. While left is less than right do Steps 6 through 10
6. If the item at position left is not 0 then increase left by 1
7. Else (the item at position left is 0) do Steps 8 through 10
8. Reduce legit by 1
9. Copy the item at position right into position left
10. Reduce right by 1
11. If the item at position left is 0, then reduce legit by 1
12. Stop
____ are useful for rating one machine against another and for rating how sensitive a particular algorithm is with respect to variations in input on one particular machine.
Free
(Multiple Choice)
4.8/5
(43)
Correct Answer:
B
Given a sorted list, the sequential search algorithm is more efficient than the binary search.
(True/False)
4.9/5
(37)
If an Q(n²) algorithm and an Q(n) algorithm exist for the same task, then for large enough n, the Q(n²) algorithm does more work and takes longer to execute, regardless of the constant factors for peripheral work.
(True/False)
4.7/5
(42)
Discuss at length both the best and worst case of the pattern-matching algorithm.
(Essay)
4.8/5
(45)
____________________ is the term to describe an algorithm's careful use of resources.
(Short Answer)
4.7/5
(37)
Problems for which no known polynomial solution algorithm exists are sometimes approached via ____ algorithms.
(Multiple Choice)
4.9/5
(29)
In the sequential search algorithm, the worst case occurs when the value being searched for is the ____ value in the list.
(Multiple Choice)
4.9/5
(39)
Binary search uses significantly more space than sequential search.
(True/False)
4.8/5
(35)
Explain the sentence: The selection sort algorithm not only does comparisons; it also does exchanges.
(Essay)
4.9/5
(33)
First and foremost, we expect elegance from our algorithms. _________________________
(True/False)
4.8/5
(33)
In the sequential search algorithm, the worst case occurs when the value being searched for is the first value in the list. _________________________
(True/False)
4.8/5
(28)
The properties that make better algorithms are very similar to the properties we look for when purchasing a car.
(True/False)
4.9/5
(35)
If an algorithm is more time efficient and less space efficient, what is this called?
(Short Answer)
4.9/5
(35)
Part of the job of program ____ is to make clear any assumptions or restrictions about the input size the program was designed to handle.
(Multiple Choice)
5.0/5
(35)
The shuffle-left algorithm is not space-efficient. _________________________
(True/False)
4.9/5
(44)
The number of comparisons done by the selection sort algorithm does not grow at the same rate as the problem size n, instead it grows at approximately the ____________________ of that rate.
(Short Answer)
4.9/5
(34)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)