Exam 10: Algorithm Efficiency and Sorting

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

An algorithm's time requirements can be derived as a function of the problem size.

Free
(True/False)
4.9/5
(37)
Correct Answer:
Verified

True

Suppose we wish to sort an array of 3-digit integers using radix sort.We will make three passes over the elements of the array.What occurs during the first pass?

Free
(Short Answer)
4.9/5
(48)
Correct Answer:
Verified

The elements are sorted according to their 1's (rightmost)digit.

In the worst case,how many comparisons are required in the bubble sort?

Free
(Essay)
4.8/5
(34)
Correct Answer:
Verified

In the worst case,the bubble sort requires n * (n - 1)/2 comparisons.

The value of which of the following growth-rate functions grows the slowest?

(Multiple Choice)
4.9/5
(36)

The recursive binary search algorithm is a logarithmic algorithm.

(True/False)
4.9/5
(37)

What is measured by an algorithm's growth rate?

(Essay)
4.9/5
(29)

In the best case,a sequential search is ______.

(Multiple Choice)
4.8/5
(50)

If a problem of size n requires time that is directly proportional to n,the problem is ______.

(Multiple Choice)
4.9/5
(36)

What measurements are parts of a program's efficiency?

(Essay)
5.0/5
(30)

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 ______ write operations.

(Multiple Choice)
4.8/5
(37)

In the worst case,a binary search is ______.

(Multiple Choice)
4.9/5
(31)

What is determined by worst-case analysis?

(Essay)
4.9/5
(32)

An algorithm's execution time is related to the number of ______ it requires.

(Multiple Choice)
4.8/5
(42)

For large arrays,the insertion sort is prohibitively inefficient.

(True/False)
4.8/5
(35)

What does the area analysis of algorithms focus on?

(Essay)
4.9/5
(41)

Which of the following is NOT part of the human cost of developing a computer program?

(Multiple Choice)
4.8/5
(38)

What is determined by average-case analysis?

(Essay)
5.0/5
(43)

What is the drawback of the mergesort with respect to storage?

(Essay)
4.9/5
(34)

Each merge step of the mergesort requires ______ major operations.

(Multiple Choice)
4.9/5
(42)

The quicksort is ______ in the worst case.

(Multiple Choice)
4.7/5
(43)
Showing 1 - 20 of 60
close modal

Filters

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