Exam 10: Algorithm Efficiency and Sorting
Exam 1: Review of Java Fundamentals60 Questions
Exam 2: Principles of Programming and Software Engineering60 Questions
Exam 3: Recursion: the Mirrors60 Questions
Exam 4: Data Abstraction: The Walls60 Questions
Exam 5: Linked Lists60 Questions
Exam 6: Problem Solving With Abstract Data Types60 Questions
Exam 7: Stacks60 Questions
Exam 8: Queues60 Questions
Exam 9: Advanced Java Topics60 Questions
Exam 10: Algorithm Efficiency and Sorting60 Questions
Exam 11: Trees60 Questions
Exam 12: Tables and Priority Queues60 Questions
Exam 13: Advanced Implementations of Tables60 Questions
Exam 14: Graphs60 Questions
Exam 15: External Methods30 Questions
Select questions type
The selection sort is continued until ______ of the n items in an array have been swapped.
(Multiple Choice)
4.8/5
(37)
Which of the following can be used to compare two algorithms?
(Multiple Choice)
4.8/5
(41)
In the worst case,the insertion sort's comparison occurs ______ times.
(Multiple Choice)
4.8/5
(37)
An exponential algorithm has the growth-rate function ______.
(Multiple Choice)
4.9/5
(40)
When choosing between two algorithms,under what conditions can the efficiencies of the algorithms be ignored?
(Essay)
4.9/5
(46)
The values of the growth-rate function O(log2ⁿ)grow faster than the values of the growth-rate function O(n).
(True/False)
4.8/5
(40)
According to the following statements:
Algorithm A requires time proportional to n
Algorithm B requires time proportional to n2
algorithm B's time requirement - as a function of the problem size n - increases at a slower rate than algorithm A's time requirement.
(True/False)
4.8/5
(38)
Consider an algorithm that contains loops of the form: for (x = 1 through n ){
For (y = 1 through x){
For (z = 1 through 10){
Task T
} // end for
} // end for
} // end for
If task T requires t time units,the loop on y requires ______ time units.
(Multiple Choice)
4.8/5
(27)
List the three factors which can cloud the comparison of algorithms performed by implementing the algorithms in Java and running the programs.
(Essay)
4.7/5
(37)
Compare the efficiencies of the quicksort and the mergesort in the worst case.
(Essay)
4.9/5
(34)
Algorithm analysis should be independent of all of the following EXCEPT ______.
(Multiple Choice)
4.8/5
(37)
The ______ compares adjacent items and exchanges them if they are out of order.
(Multiple Choice)
4.9/5
(32)
Assuming a linked list of n nodes,the code fragment: Node curr = head;
While (curr != null){
System.out.println(curr.getItem());
Curr.setNext(curr.getNext());
} // end while
Requires ______ assignments.
(Multiple Choice)
4.7/5
(42)
Consider the following nested loop.What is the order of the algorithm?
for (int i = 0;i < n;++i)
for (j = 1;j < n;j *= 2)
…
(Short Answer)
5.0/5
(27)
Which of the following growth-rate functions indicates a problem whose time requirement is independent of the size of the problem?
(Multiple Choice)
4.9/5
(47)
Showing 21 - 40 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)