M5-M6

Ace your homework & exams now with Quizwiz!

Filling multiple blanks. Consider the sequence A = <3, 0, 3, 2, 0, 3, 4, 2>. Using Counting Sort, filling in below the counter array C just after Lines 4-5 are executed.

2 0 2 3 1

Fill in multiple blanks. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (2,8,7,1,3,5). After executing Partition , the sequence A will become:

2 1 3 5 7 8

Filling multiple blanks. Consider the sequence A = <3, 0, 3, 2, 0, 3, 4, 2>. Using Counting Sort, filling in below the counter array C just after Lines 7-8 are executed.

2 2 4 7 8

Filling multiple blanks. Consider the sequence A = <0, 1, 3, 0, 3, 2, 2, 1>. Using Counting Sort, filling in below the counter array C just after Lines 7-8 are executed.

2 4 6 8

Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (15, 2, 6, 4, 3, 7). After executing Partition , the sequence A will become:

2 6 4 3 7 15

Select the best answer. Consider the decision-tree to sort a 4 element sequence (a1, a2, a3,a4) in increasing order. The number of possible permutations is _________.

24

Select the best answer. Consider any decision-tree T with height 5. Then the treeT will have at most ________ reachable leaves.

2^5 = 32

Select the best answer. Consider any decision-tree T with height n. Then the treeT will have at most ________ reachable leaves.

2^n

Consider the pseudocode of Partition. This algorithm is used to partition the sequence A =(5,15,7,3,8,10,12,6). Partition will return the index _______ (the index for the pivot).

3

Numerical answer. Consider the Counting Sort algorithm below executing on the sequence A = <3, 0, 3, 2, 0, 3, 3>. The body of the for loop in Lines 7-8 executes ______ additions.

3

Select the best answer. Consider the decision-tree to sort a 3 element sequence (a1, a2, a3) in increasing order. If (a1, a2, a3) = (4, 9, 5), the sorting will complete after ________ comparison(s)

3

Select the best answer. Consider the decision-tree to sort a 3 element sequence (a1, a2, a3) in increasing order. If (a1, a2, a3) = (8, 3, 5), the sorting will complete after ________ comparison(s)

3

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (2,8,7,1,4,5,6,3). Partition will return the index _______ (the index for the pivot).

3

log 10 (1000)

3

Select the best answer. Each letter is associated with a bound. a. theta (n) b. theta (n^2) c. theta (n log n) d theta (log^2 n) The running time of InsertSort in the best case is the bound associated with the letter _______.

a. theta (n)

Check all that apply. Each letter is associated with a bound. a. theta (n^2) b. theta (n) c. omega (n) d bigO (n) The best case running time of InsertSort belongs to the bound associated with the letter _______.

a. theta (n^2) b. theta (n) c. omega (n)

The running time of QuickSort depends only on the input size.

False

True or False. Radix Sort is an in place algorithm.

False

True or False. The running time of InsertSort depends only on the input size.

False

Select the best answer. Consider any decision-tree T with height 6. Then the treeT will have at most ________ reachable leaves.

64

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (15, 2, 6, 4, 3, 1, 5, 7). When the for loop completes for j = 3, the sequence A will be _________________.

( 2, 6, 15, 4, 3, 1, 5, 7)

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (15, 2, 6, 4, 3, 1, 5, 7). When the for loop completes for j = 7, the sequence A will be _________________.

(1, 2, 3, 4, 5, 6, 15, 7)

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (15, 2, 6, 4, 3, 1, 5, 7). When the for loop completes for j = 6, the sequence A will be _________________.

(1, 2, 3, 4, 6, 15, 5, 7)

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (15, 2, 6, 4, 3, 1, 5, 7). When the for loop completes for j = 2, the sequence A will be _________________.

(2, 15, 6, 4, 3, 1, 5, 7)

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (15, 2, 6, 4, 3, 1, 5, 7). When the for loop completes for j = 5, the sequence A will be _________________.

(2, 3, 4, 6, 15, 1, 5, 7)

Select the best answer. Consider the pseudocode of InsertSort. In the best case, the body of the while loop (Lines 6-7) is executed ___________ time(s).

0

Select the best answer. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Before the first iteration of the for loop (Lines 3-6), there are _____ items between the indices (i+1) and (j-1) (excluding items at Indices (i+1) and (j-1))

0

Filling multiple blanks. Consider the sequence A = <4, 1, 3, 4, 0, 2, 3, 1>. Using Counting Sort, filling in below the counter array C just after Lines 2-3 are executed.

0 0 0 0 0

Filling multiple blanks. Consider the sequence A = <4, 1, 3, 4, 3, 2, 3, 1>. Using Counting Sort, filling in below the counter array C just after Lines 10-12 are executed.

0 0 2 3 6

Filling multiple blanks. Consider the sequence A = <4, 1, 3, 4, 3, 2, 3, 1>. Using Counting Sort, filling in below the counter array C just after Lines 4-5 are executed.

0 2 1 3 2

Filling multiple blanks. Consider the sequence A = <4, 1, 3, 4, 3, 2, 3, 1>. Using Counting Sort, filling in below the counter array C just after Lines 7-8 are executed.

0 2 3 6 8

Filling multiple blanks. Consider the sequence A = <0, 1, 0, 2, 0, 3, 0, 4>. Using Counting Sort, filling in below the counter array C just after Lines 10-12 are executed.

0 4 5 6 7

Filling multiple blanks. Consider the sequence A = <4, 1, 3, 4, 0, 2, 3, 1>. Using Counting Sort, filling in below the counter array C just after Lines 7-8 are executed

1 3 4 6 8

Numerical answer. Consider the Counting Sort algorithm below executing on the sequence A = <3, 0, 3, 2, 0, 3, 4, 2, 1, 0>. The body of the for loop in Lines 4-5 executes ______ additions.

10

Numerical answer. Consider the Counting Sort algorithm below executing on the sequence A = <3, 0, 3, 2, 0, 3, 4, 2, 1, 4>. The body of the for loop in Lines 4-5 executes ______ additions.

10

log 2 (2^15)

15

Select the best answer. Consider any comparison-based sorting algorithm A. Algorithm A will perform at least ________ comparisons to sort a sequence with 8 elements for the worst case.

16

When developing the recurrence tree, the 5th level ("5th call") has __________ nodes

16

Select the best answer. At each call, Merge-Sort divides the sequence in _______ sequences.

2

Select the best answer. Consider the decision-tree to sort a 3 element sequence (a1, a2, a3) in increasing order. If (a1, a2, a3) = (4, 5, 9), the sorting will complete after ________ comparison(s)

2

Select the best answer. Consider the decision-tree to sort a 3 element sequence (a1, a2, a3) in increasing order. If (a1, a2, a3) = (8, 5, 9), the sorting will complete after ________ comparison(s)

2

Select the best answer. Consider the pseudocode of Bucket Sort (see below) to sort a sequence with 5 elements. The element 0.456 will be placed in Bucket # _____.

2

When developing the recurrence tree, the 2nd level ("2nd call") has __________ nodes

2

Provide a numerical answer. Consider the following recurrence relation: Let c be 3. If we expand T(4), then T(4) = _____

36

Numerical answer. Consider the Counting Sort algorithm below executing on the sequence A = <1, 0, 2, 2, 0, 0, 1, 2>. The for loop in Line 2 executes ______ comparisons.

4

Numerical answer. Consider the Counting Sort algorithm below executing on the sequence A = <3, 0, 3, 2, 0, 3, 4, 2, 1, 4>. The body of the for loop in Lines 7-8 executes ______ additions.

4

Numerical answer. Consider the Counting Sort algorithm below executing on the sequence A = <3, 0, 3, 2, 0, 3, 4, 2>. The body of the for loop in Lines 7-8 executes ______ additions.

4

Numerical answer. Consider the sequence A = <0, 4, 0, 4, 0, 4, 0, 4>. Using Counting Sort, what is the range k of Sequence A?

4

Select the best answer. Consider the pseudocode of Bucket Sort (see below) to sort a sequence with 10 elements. The element 0.456 will be placed in Bucket # _____.

4

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (2,8,7,1,3,5,6,4). Partition will return the index _______ (the index for the pivot).

4

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (2,8,7,1,3,5,6,4). Partition will take ___ as the pivot value.

4

Filling multiple blanks. Consider the sequence A = <0, 4, 0, 4, 0, 4, 0, 4>. Using Counting Sort, filling in below the counter array C just after Lines 4-5 are executed.

4 0 0 0 4

Filling multiple blanks. Consider the sequence A = <0, 4, 0, 4, 0, 4, 0, 4>. Using Counting Sort, filling in below the counter array C just after Lines 7-8 are executed.

4 4 4 4 8

Select the best answer. Consider the pseudocode of Bucket Sort (see below) to sort a sequence with 100 elements. The element 0.436 will be placed in Bucket # _____.

43

Select the best answer. Consider any comparison-based sorting algorithm A. Algorithm A will perform at least ________ comparisons to sort a sequence with 16 elements for the worst case.

45

Select the best answer. Consider the pseudocode of Bucket Sort (see below) to sort a sequence with 100 elements. The element 0.456 will be placed in Bucket # _____.

45

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (21, 11, 13, 9, 7, 3, 5, 16). When the for loop completes for j = _____, the sequence A will be (7, 9, 11, 13, 21, 3, 5, 16).

5

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (15, 2, 6, 4, 3, 7). Partition will return the index _______ (the index for the pivot).

5

Check all that apply. Consider the pseudocode of Bucket Sort (see below) to sort a sequence with n elements. In the worst case scenario, Statement in Line ________ has a O(n) running time.

5 6 4 9

Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (5,15,7,3,8,10). After executing Partition , the sequence A will become:

5 7 3 8 10 15

When developing the recurrence tree, the sum of the costs of all nodes at the ith level ("ith call") is ____________ when c = 5

5.n

Select the best answer from each dropdown menu. Radix Sort is used to sort this sequence A = <6720, 5829, 7657, 9329, 8457, 8436, 9355>. After the second round (a sort based on the second digit), the sequence will be:

5829 9329 7657 8457

Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (5,15,7,3,8,10,12,6). Partition will take ___ as the pivot value.

6

If we call Merge(A, 10, 19,25), the body of the for-loop at Line 6 will run ____ times.

6

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (5,15,7,3,8,10,12,6). Partition will take ___ as the pivot value.

6

Select the best answer. Consider the decision-tree to sort a 6 element sequence (a1, a2, a3, a4, a5, a6) in increasing order. The height of the decision tree will be at least __________.

6!=720 < 2^10= 1024 =10

Select the best answer from each dropdown menu. Radix Sort is used to sort this sequence A = <720, 829, 657, 329, 457, 436, 355>. After the first round (a sort based on the first digit), the sequence will be:

657 457 829 329

If we call Merge(A, 10, 19,25), the right subsequence R has __________ elements.

7

Select the best answer. Consider the decision-tree to sort a 5 element sequence (a1, a2, a3, a4, a5) in increasing order. The height of the decision tree will be at least __________.

7

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (21, 11, 13, 9, 7, 3, 5, 16). When the for loop completes for j = _____, the sequence A will be (3, 5, 7, 9, 11, 13, 21, 16).

7

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (15, 2, 6, 4, 3, 7). Partition will take ___ as the pivot value.

7

We plan to use the Master Theorem to solve this recurrence relation: T(n) = 7T(n/2) + n^2.

7 2 n^2 1

Fill in multiple blanks. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (15,7,3,8,10,12). After executing Partition , the sequence A will become:

7 3 8 10 12 15

Numerical answer. Consider the Counting Sort algorithm below executing on the sequence A = <3, 0, 3, 2, 0, 3, 4, 2>. The body of the for loop in Lines 4-5 executes ______ additions.

8

Select the best answer from each dropdown menu. Radix Sort is used to sort this sequence A = <720, 829, 657, 329, 457, 436, 355>. After the second round (a sort based on the second digit), the sequence will be:

829 329 657 457

Select the best answer. Consider the pseudocode of Bucket Sort (see below) to sort a sequence with 20 elements. The element 0.456 will be placed in Bucket # _____.

9

Check all that apply. Consider the pseudocode of Bucket Sort (see below) to sort a sequence with n elements. In the worst case scenario, Statement in Line ________ has a O(n) running time.

9 6 5 4

Select the best answer from each dropdown menu. Radix Sort is used to sort this sequence A = <6720, 5829, 7657, 9329, 8457, 8436, 9355>. After the third round (a sort based on the third digit), the sequence will be:

9329 8457 7657 5829

Select the best answer. Consider the decision-tree to sort a 3 element sequence (a1, a2, a3) in increasing order. If (a1, a2, a3) = (6, 3, 9), then the leaf that will be reached is __________.

<2, 1, 3>

Check all that apply. Consider the pseudocode of the Bucket Sort algorithm below. The worst case running time of the Bucket Sort algorithm would be Θ(n) if _______________ can be used to sort each bucket.

Counting Sort

Select the best answer. In general, the best sorting algorithm that Radix Sort should use to sort the entries based on the individual digits is _____________.

Counting Sort

Bucket Sort is an in place algorithm.

False

Select the best answer. The Bucket Sort algorithm presented in the lecture uses ___________ to sort elements in each bucket.

Insert Sort

Check all that apply. _________________ is stable.

Insert Sort Counting Sort Merge Sort

Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (21, 11, 13, 9, 7, 3, 5, 16). When the for loop completes for j = _____, the sequence A will be (11, 9, 13, 21, 7, 3, 5, 16).

None of these answers

Select the best answer. Consider the pseudocode of InsertSort. For each value of j, the while loop in lines 5-7 runs always _______ time(s) assuming that A.length is n.

None of these answers

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (21, 11, 13, 9, 7, 3, 5, 16). When the for loop completes for j = _____, the sequence A will be (3, 5, 7, 9, 11, 16, 21, 13).

None of these answers

Select the best answer. Consider the pseudocode of InsertSort. This algorithm is used to sort the sequence A = (21, 11, 13, 9, 7, 3, 5, 16). When the for loop completes for j = _____, the sequence A will be (5, 7, 9, 11, 13, 21, 3, 16).

None of these answers

Select the best answer. Consider the pseudocode of Partition. For each value of j, the instruction i=i+1 (Line 5) is executed ______ time(s) assuming n is the input size (n = r - p +1).

None of these answers

We plan to use the Master Theorem to solve this recurrence relation: T(n) = 4T(n/2) - log n . theta (log^2 n ) theta (n^2) theta (n log^2 n ) theta (n^2 log^2 n )

None of these answers

If T(n) is the running time of Merge-Sort for an n size input, then the relation recurrence is for n > 1 is _________________ if the running time for Merge is f(n).

T(n) = 2 T(n/2) + f(n)

Select the best answer. Consider the pseudocode of QuickSort. In the best case, the recurrence relation would be ____________.

T(n) = 2T(n/2) + Θ(n)

Select the best answer. Consider the pseudocode of QuickSort. In the general case, the recurrence relation for the ith recursive call would be ____________.

T(n) = T(α(i).n) + T((1-α(i)).n)+ Θ(n) with 0 ≤ α(i) ≤ 1

Select the best answer. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. The Partition function returns _______________.

The index of the pivot.

Check all that apply. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. When the for loop (Lines 3-6) terminates, check all true statements that are true before Line 7 is executed.

The pivot is still at Index r.

Check all that apply. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. When the Partition terminates, check all true statements that are true.

The pivot x is placed between the two sets of smaller and greater elements.

True or False. InsertSort is an in place algorithm.

True

Select the best answer. Each letter is associated with a bound. a. theta (n) b. theta (n^2) c. theta (n log n) d theta (log^2 n) The running time of InsertSort in the average case is the bound associated with the letter _______.

b. theta (n^2)

Check all that apply. Consider the Merge procedure below. The running time of Merge belongs to f1(n), theta (n) f2(n), Big O(n) f3(n), Omega (n) f4(n) theta (n^2) as defined below:

f1(n), theta (n) f2(n), Big O(n) f3(n), Omega (n)

True or False. Counting Sort is an in place algorithm.

false

This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check all actions taken in the body of the for loop (Lines 3-6) when A[j] ≤ x.

i = i + 1 exchange A[i] with A[j]

Check all that apply. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check the helpful loop invariants of the for loop (Lines 3-6). Helpful loop invariants are the invariants that help proving that Partition produces the desired result.

if k = r, then A[k] = x if i+1 ≤ k ≤ j-1, then A[k] > x if p ≤ k ≤ i, then A[k] ≤ x

This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check all loop invariants of the for loop (Lines 3-6).

if k = r, then A[k] = x if p ≤ k ≤ i, then A[k] ≤ x if i+1 ≤ k ≤ j-1, then A[k] > x

Check all that apply. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check the helpful loop invariants of the for loop (Lines 3-6). Helpful loop invariants are the invariants that help proving that Partition produces the desired result.

if p ≤ k ≤ i, then A[k] ≤ x

Check all that apply. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check all loop invariants of the for loop (Lines 3-6).

if p ≤ k ≤ i, then A[k] ≤ x if i+1 ≤ k ≤ j-1, then A[k] > x

Select the best answer. Consider the pseudocode of InsertSort. In the worst case, the body of the while loop (Lines 6-7) is executed ___________ time(s) for a given value of j.

j -1

Check all that apply. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check all actions taken in the body of the for loop (Lines 3-6) when A[j] > x.

j = j + 1

Fill in the blank. Consider the Counting Sort algorithm below. The body of the for loop in Lines 7-8 executes ______ additions assuming that A.length is n.

k

Select the best answer. Consider any comparison-based sorting algorithm A. Algorithm A will perform in the worst case at least ________ comparisons to sort a sequence with m elements..

lg(m!)

ln(a x b )

ln(a) + ln(b)

log (x/2)

log x - log 2

Consider the Counting Sort algorithm below. The body of the for loop in Lines 10-12 executes ______ subtractions assuming that A.length is n.

n

Fill in the blank. Consider the Counting Sort algorithm below. The body of the for loop in Lines 4-5 executes ______ additions assuming that A.length is n.

n

Select the best answer. Consider the pseudocode of Bucket Sort (see below). Statement at Line 8 may have to sort a bucket containing up to ____________ elements.

n

Select the best answer. Consider the pseudocode of Bucket Sort (see below). The body of the for loop in Lines 3-4 is executed _________ times.

n

Select the best answer. Consider the pseudocode of Bucket Sort (see below). The for loop in Lines 7-8 sorts _____ buckets.

n

Select the best answer. Consider the pseudocode of InsertSort. In the best case, the for loop statement (Line 1) executes ___________ comparisons.

n

Select the best answer. Consider the pseudocode of InsertSort. In the worst case, the for loop statement (Line 1) executes ___________ comparisons.

n

Select the best answer. Consider any comparison-based algorithm A to sort an n element sequence (a1, a2, .... an) in increasing order. The decision-tree of Algorithm A will have at least ________ leaves.

n!

Select the best answer. Consider the decision-tree to sort a 5 element sequence (a1, a2, a3, a4, a5) in increasing order. The number of possible permutations is _________.

n! = 120

Consider the pseudocode of InsertSort. The for loop in lines 1-8 runs always _______ time(s) assuming that A.length is n.

n-1

Consider the pseudocode of Partition. The body of the for loop (Lines 3-6) is executed ___________ time(s) assuming that n is the input size (n= r - p + 1).

n-1

Select the best answer. Consider the pseudocode of Partition. The body of the for loop (Lines 3-6) is executed ___________ time(s) assuming that n is the input size (n= r - p + 1).

n-1

Select the best answer. Consider the pseudocode of Partition. The for loop in lines 3-6 runs always _______ time(s) assuming that n is the input size (n=r-p+1).

n-1

Check all that apply. The QuickSort algorithm is _______________.

recursive a divide-and-conquer algorithm

Select the best answer. The InsertSort algorithm is _______________.

similar to sorting a hand of playing cards

Select the best answer. Consider the pseudocode of InsertSort. The best case running time occurs when _______________.

the input is already sorted in the desired order

Consider the pseudocode of InsertSort. The worst case running time occurs when _______________.

the input is already sorted in the inverse of the desired order

Consider the pseudocode of QuickSort. The worst case running time occurs when _______________.

the input is already sorted in the inverse of the desired order the input is already sorted in the desired order

Select the best answer. Consider the pseudocode of QuickSort. The best case running time occurs when _______________.

the input is such that each recursive call produces equal subsequences.

This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check all consequences in the for loop (Lines 3-6) when A[j] > x.

the set of items greater than x expands

Check all that apply. This question is about the correctness of the Partition procedure that is at the heart of QuickSort. Below is the pseudocode of Partition. Check all consequences in the for loop (Lines 3-6) when A[j] ≤ x.

the set of items less than or equal to x expands

Select the best answer. Consider the for loop (Lines 1-8) in the pseudocode of InsertSort. The most helpful loop invariant to prove correctness is _______________.

the subarray A[1..j-1] consists of the elements originally in A[1..j-1], but in sorted order

Check all that apply. Consider the for loop (Lines 1-8) in the pseudocode of InsertSort. Check all loop invariants.

the subarray A[1..j-1] consists of the elements originally in A[1..j-1], but in sorted order i < j

We plan to use the Master Theorem to solve this recurrence relation: T(n) = 3T(n/2) + n^2. theta (n^2 log n ) theta (n log n) theta (n^2 ) theta (n )

theta (n^2 )

Select the best answer. We plan to use the Master Theorem to solve this recurrence relation: T(n) = sqrt(2)T(n/2) + log n. Using the Master theorem below, select the solution for the above recurrence relation.

theta (sqrt n)

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (2,8,7,1,3,5,6,4). Partition will partition A into these three sets _____________________.

{2, 1, 3}, {4}, {5, 6, 7, 8}

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (2,8,7,1,4,5,6,3). Partition will partition A into these three sets _____________________.

{2, 1}, {3}, {8, 4, 5, 6, 7}

Select the best answer. Consider the pseudocode of Partition. This algorithm is used to partition the sequence A = (15, 2, 6, 4, 3, 7). Partition will partition A into these three sets _____________________.

{2, 6, 4, 3}, {7}, {15}

Select the best answer. Consider a sequence of m words that have up to 10 uppercase characters (no digits). We plan to use Radix Sort which uses Counting Sorting to sort the elements based on the characters . The running time of Radix Sort is ______.

Θ(10(m+25))

Select the best answer. Consider a sequence of p integers that have up to 16 decimal digits. We plan to use Radix Sort which uses Counting Sorting to sort the elements based on the digits . The running time of Radix Sort is ______.

Θ(16(p+9))

Select the best answer. Consider a sequence of p integers that have up to 9 hexadecimal digits. We plan to use Radix Sort which uses Counting Sorting to sort the elements based on the digits . The running time of Radix Sort is ______.

Θ(9(p+15))

Select the best answer. Consider a sequence of m words that have up to d uppercase letters (no digits). We plan to use Radix Sort which uses Counting Sorting to sort the elements based on the characters . The space complexity of Radix Sort is ______.

Θ(m+25)

The running time of QuickSort in the average case belongs to the bound associated with the letter _______.

Θ(n log n)

Consider the pseudocode of Partition. The running time of Partition is ___________.

Θ(n)

Select the best answer. Consider the pseudocode of Partition. The running time of Partition is ___________.

Θ(n)

Select the best answer. Consider the pseudocode of the Bucket Sort algorithm below. The running time of the Bucket Sort algorithm is __________ in the average case when the elements are uniformly distributed.

Θ(n)

The space complexity of QuickSort is _______.

Θ(n)

Check all that apply. The space complexity of QuickSort is _______.

Θ(n) O(n) Ω(n)

Select the best answer. Consider a sequence of n elements that have up to d digits. Each digit can take up to k values. We plan to use Radix Sort which uses Counting Sorting to sort the elements based on the digits . The space complexity of Radix Sort is ______.

Θ(n+k)

The running time of QuickSort in the worst case belongs to the bound associated with the letter _______.

Θ(n^2)

Select the best answer. Consider a sequence of p integers varying from 0 to r. The running time of Counting Sorting of is _________.

Θ(p+r)


Related study sets

Art History Survey II Quiz Stuff

View Set

"First Aid- Chapter 23: Disaster, Remote, and Wilderness Emergencies"

View Set

Chapter 5: Competitive Rivalry & Competitive Dynamics

View Set

Chapter 6 Quiz: Development of the Person

View Set