Exam 10: Algorithm Efficiency and Sorting

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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)

How does the quicksort partition an array?

(Essay)
5.0/5
(37)

Algorithm efficiency is typically a concern for ______.

(Multiple Choice)
4.8/5
(37)

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)

A linear algorithm has the growth-rate function ______.

(Multiple Choice)
5.0/5
(35)

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)

A quadratic algorithm has the growth-rate function ______.

(Multiple Choice)
4.8/5
(41)

What is the sort key of a record?

(Essay)
4.7/5
(39)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)