Exam 10: Algorithm Efficiency and Sorting

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

What is an external sort?

(Essay)
4.7/5
(36)

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

(Multiple Choice)
4.9/5
(40)

Suppose we have three algorithms,and their orders are O(n²),O(2ⁿ)and O(log2 n).Arrange these orders in increasing magnitude.

(Short Answer)
4.7/5
(37)

If an algorithm requires 2ⁿ³ + 17n² + 54n + 512 operations to perform,where n is the size of the input data,then we say the order of the algorithm is O(_____).

(Short Answer)
4.8/5
(36)

The analysis of an algorithm must take into consideration the computer that will be used to run a program that implements the algorithm.

(True/False)
4.9/5
(32)

The efficiency of the selection sort depends on the initial arrangement of the data.

(True/False)
4.7/5
(34)

Given the following array: 4 15 8 3 28 21 Which of the following represents the array after the second swap of the selection sort?

(Multiple Choice)
4.7/5
(39)

Given the fact that a selection sort of n items requires n²/2 + 5 * n/2 - 3 major operations,the selection sort is ______.

(Multiple Choice)
4.9/5
(33)

What is an internal sort?

(Essay)
4.7/5
(41)

A bubble sort requires at most ______ passes to sort an array of n items.

(Multiple Choice)
4.9/5
(29)

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 ______ comparisons.

(Multiple Choice)
4.8/5
(31)

The solution to the Towers of Hanoi problem with n disks requires 2ⁿ - 1 moves.If each move requires the same time m,the solution requires ______ time units.

(Multiple Choice)
5.0/5
(31)

The mergesort is a recursive sorting algorithm.

(True/False)
4.7/5
(32)

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 innermost loop on z requires ______ time units.

(Multiple Choice)
4.8/5
(34)

Low-order terms can be ignored in an algorithm's growth-rate function.

(True/False)
4.8/5
(34)

A growth-rate function of ______ implies a problem whose time requirement is constant.

(Multiple Choice)
4.9/5
(31)

Given the statement: Algorithm A requires time proportional to f(n) Algorithm A is said to be ______.

(Multiple Choice)
4.8/5
(36)

Consider the following nested loop.What is the order of the algorithm? for (int i = 0;i < n;++i) for (int j = i;j < n;++j) for (int k = 1;k < 100;++k) …

(Short Answer)
4.8/5
(42)

What is a growth-rate function?

(Essay)
4.8/5
(34)

To sort numeric data,the radix sort treats a number as a character string.

(True/False)
4.7/5
(39)
Showing 41 - 60 of 60
close modal

Filters

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