Chapter 1-6

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Given the number list (2, 12, 8, 19, 5, 30), identify the merged list in merge sort after the completion of the second level. (2, 12, 8) and (5, 19, 30) (2, 8, 12) and (5, 19, 30) (2, 5, 8) and (12, 19, 30) (2, 12, 8) and (19, 5, 30)

(2, 8, 12) and (5, 19, 30)

Using double hashing, how is the index determined when inserting item 20? hash1(key) = key % 11 hash2(key) = 5 - key % 5 and a hash table with a size of 10 (20 % 11 + 1 * (5 - 20 % 5)) % 10 (20 % 11 + 0 * (5 - 20 % 5)) % 10 (20 % 11 + 0 * (5 - 20 % 5)) % 11 (20 % 11 + 1 * (5 - 20 % 5)) % 11

(20 % 11 + 0 * (5 - 20 % 5)) % 10

Sort the following list of video extensions using selection sort: mpg, mp4, mov, mkv, m4v. What is the order of the elements after the second swap? (m4v, mp4, mov, mkv, mpg) (m4v, mkv, mov, mp4, mpg) (mpg, mp4, mov, mkv, m4v) (mov, mkv, mpg, mp4, m4v)

(m4v, mkv, mov, mp4, mpg)

If a hash table has 20 buckets and 12 elements, what will the load factor be? 0.8 8 1.2 0.6

0.6

TrieSearch(root, "RAIN") visits _____ node(s) when searching the trie below. Trie details: Representing strings sleet, snow, sun. 1 3 6 7

1

What is the height of a BST built by inserting nodes in the order 20, 10, 30? 3 2 0 1

1

If search key = 9, identify the sequence of nodes that are visited and the outcome. 10 ⇢ 8 ⇢ 9 ⇢ 9 10 ⇢ 11 ⇢ 8 ⇢ 9 10 ⇢ 8 ⇢ 11 ⇢ 9 10 ⇢ 8 ⇢ 9

10 ⇢ 8 ⇢ 9

Assume an ordered list containing the English alphabet. Using linear search, how many letters are checked to locate the letter "K"? 11 10 9 26

11

When the Java code below is executed, the first two elements swapped are ____. int[]numbers={15,39,77,14}; selectionSort(numbers); 15 and 39 77 and 14 39 and 77 15 and 14

15 and 14

Consider the following hash table, a first hash function of key % 5, and a second hash function of 10 - key % 10. Then, HashSearch(valsTable, 44) probes _____ buckets. javaCopy code // Hash table setup hashTable is a hash table with buckets 0 to 7. Table contains the following entries: bucket 0 is empty after removal, bucket 1 is occupied and contains 11, bucket 2 is empty from start, bucket 3 is occupied and contains 33, bucket 4 is empty after removal, bucket 5 is empty from start and contains 53, bucket 6 is occupied and contains 66, bucket 7 is empty from start. 1 2 3 4

2

Identify the outcome of the following function calls. Binary tree details: Root node A, A's left child X, right child Y. X's left child P, right child Q. P's left child F, right child G. Q's left child R, right child S. Y's left child C, right child D. BSTGetHeight(node X) BSTGetHeight(node C) BSTGetHeight(node Q) BSTGetHeight(node A) 3, 1, 2, 4 2, 0, 1, 3 2, 0, 2, 3 2, 1, 2, 3

2, 0, 1, 3

The array (67, 23, 32, 80, 53, 60) is to be sorted using selection sort. What is the order of the elements after the third swap? 23, 32, 53, 80, 67, 60 23, 32, 67, 53, 80, 60 23, 32, 53, 67, 80, 60 23, 32, 80, 53, 60, 67

23, 32, 53, 80, 67, 60

Consider a hash table using chaining with 10 buckets and a hash function of key % 10. What would bucket 3's list be after the following operations? javaCopy code HashInsert(hashTable, item 12) HashInsert(hashTable, item 23) HashInsert(hashTable, item 34) HashInsert(hashTable, item 45) HashInsert(hashTable, item 33) HashInsert(hashTable, item 31) HashInsert(hashTable, item 30) 23, 33 23, 30, 31, 33 34, 33 24, 33, 31, 30

23, 33

Consider the following hash table, and a hash function of key % 10. How many list items will be compared for the search operations in the given sequence? javaCopy code // Hash table setup newTable is a hash table with buckets 0 to 9. Table contains the following entries: bucket 0 contains 50, bucket 2 contains 12 and 72, bucket 3 contains 63 and 33, bucket 5 contains 45 and 95, bucket 7 contains 27. Remaining buckets are empty. // Operations HashInsert(newTable, item 25) HashInsert(newTable, item 54) HashRemove(newTable, 27) HashInsert(newTable, item 84) HashInsert(newTable, item 83) HashSearch(newTable, 72) HashSearch(newTable, 77) HashSearch(newTable, 63) 2; 0; 2 2; 0; 3 1; 0; 3 2; 0; 1

2; 0; 1

Which function best represents the number of operations in the worst-case? for(i=0;i<N;++i){ if(numbers[i]%2==1) factor=2.5 } f(N)=2N f(N)=5N+2 f(N)=6N2 f(N)=8N2+4

2N

What is the height of a BST built by inserting nodes in the order 12, 24, 23, 48, 47? 4 3 1 2

3

What is the largest number of comparisons for searching the following BST? Binary tree with root node A. A's left child is X and right child is Y. X's left child is P and right child is Q. P's left child is F and right child is G. Q's left child is R and right child is S. Answer choices: 5, 4, 3, 1

4

If a new node with key 50 is inserted into the following BST, what sequence of nodes is visited and where is the new node inserted? BST details: Root node 40, Root's left child 25, right child 80, Node 25's children 15 and 30, Node 80's children 70 and 90, Node 15's children 10 and 20, Node 70's left child 60. 40, as 40's right child 40 ⇢ 80 ⇢ 70, as 70's right child 40 ⇢ 80 ⇢ 70 ⇢ 60, as 60's left child 40 ⇢ 80 ⇢ 70 ⇢ 60, as 60's right child

40 ⇢ 80 ⇢ 70 ⇢ 60, as 60's left child

How many calls are made to the function BSTInsertRecursive when the following operations are executed on the given tree? 4 5 6 7

6

If the Java binarySearch() method is called to search a sorted array of 32 numbers, then at most _____ array numbers are compared against the search key. 6 32 36 1024

6

Consider a hash table named idTable that uses linear probing and a hash function of key % 10. What is printed after the following operations? javaCopy code HashInsert(idTable, item 45) HashInsert(idTable, item 67) HashInsert(idTable, item 76) HashInsert(idTable, item 78) HashInsert(idTable, item 79) HashInsert(idTable, item 92) HashInsert(idTable, item 87) Print HashSearch(idTable, 67) Print HashSearch(idTable, 77) Print HashSearch(idTable, 87) 67, 87 67, null, 87 67, false, 87 true, false, true

67, null, 87

Consider the following hash table, and a hash function of key % 5. What would bucket 3's list be after the following operations? hashTable is a hash table with buckets 0 to 4. Hash table uses chaining to store multiple items that map to the same bucket. Table contains the following entries: bucket 0 contains 25, 95, and 50, bucket 3 contains 68, 33, and 48, and bucket 4 contains 85 and 54. HashRemove(hashTable, 25) HashRemove(hashTable, 48) HashInsert(hashTable, item 53) 33, 53 68, 33, 53 68, 33, 48 68, 33, 48, 53

68, 33, 53

Given the list (7, 23, 12, 8, 5, 6), what is the order of the elements after the third insertion sort swap? 7, 23, 12, 8, 5, 6 7, 12, 23, 8, 5, 6 7, 8, 12, 23, 5, 6 5, 7, 8, 12, 23, 6

7, 8, 12, 23, 5, 6

Adding BADMINTON to the trie below creates _____ new nodes. Trie details: Representing strings Baseball, Basketball, and Football. 7 8 9 10

8

A list of 10 elements is to be sorted using insertion sort algorithm. How many times will the outer loop be executed? 10 1 9 2

9

Which abstract data type (ADT) is suited to check whether a given string is a palindrome? An array A linked list A deque A queue

A deque

Which is an abstract data type (ADT)? A list A string A boolean A float

A list

Which abstract data type (ADT) is most suitable to store a list of perishable products such that the product with the nearest expiry date is removed first? A deque A linked list A queue A priority queue

A priority queue

Which of the following is not an example of sorting a list? Arranging patient records alphabetically Arranging employee details based on beginning dates Arranging student records neatly on a desk Arranging musical instruments based on the number of strings they have

Arranging student records neatly on a desk

Where will a new node with key 5 be inserted into the following BST? BST details: Root node 6, left child 3, right child 8. Node 3's children 2 and 4. Node 8's children 7 and 9. As 2's right child As 4's left child As 4's right child As 7's left child

As 4's right child

What is the tree when node 4 is removed? BST with root node 6. 6's left child is 4 and right child is 8. 4's left child is 3. Binary tree with root node 6. 6's right child is 8. Binary tree with root node 6. 6's left child is 3 and right child is 8.Binary tree with root node 6. 6's right child is 8. 8's left child is 3. Binary tree with root node 6. 6's right child is 8. Node 3 is not connected to the tree.

Binary tree with root node 6. 6's right child is 8.

Consider a hash table named marksTable that uses linear probing and a hash function of key % 5. What would be the location of the item 46? javaCopy code HashInsert(marksTable, item 49) HashInsert(marksTable, item 41) HashInsert(marksTable, item 42) HashInsert(marksTable, item 44) HashInsert(marksTable, item 46) Bucket 0 Bucket 1 Bucket 2 Bucket 3

Bucket 3

A manufacturing plant has many ways to assemble a product. Which algorithm will be useful to find the quickest way? Shortest path Binary search Dijkstra's shortest path Longest common substring Question 2:

Dijkstra's shortest path

Which explanation matches the following runtime complexity? T(N) = k + T(N − 1) Every time the function is called, k operations are done, and each of the 2 recursive calls reduces N by half. Every time the function is called, k operations are done, and the recursive call lowers N by 1. Every time the function is called, k operations are done, and each recursive call lowers N by one fourth. Every time the function is called, k operations are done, and the recursive call lowers N by k.

Every time the function is called, k operations are done, and the recursive call lowers N by 1.

Identify the type of the following binary tree. Binary tree details: Root node A, A's left child X, right child Y. X's left child P, right child Q. P's left child F, right child G. Q's left child R, right child S. Not full, complete, not perfect Full, not complete, not perfect Full, complete, not perfect Full, complete, perfect

Full, not complete, not perfect

Which of the following rules does a valid BST follow? Right subtree keys ≤ node's keys Left subtree keys ≥ node's keys Left subtree keys ≤ node's keys Right subtree keys ≤ left subtree keys

Left subtree keys ≤ node's keys

Which for linear search find findEle list StudentIDs? LinearSearch(StudentIDs,int listSize,int findEle){ for(ctr=1;i<listSize;ctr++){ if(StudentIDs[ctr]==listSize) return ctr; } } ...(ctr=0;i<listSize;++ctr){ if(StudentIDs[listSize]==ctr) return findEle; } } ...(ctr=0;i<listSize;++ctr){ if(StudentIDs[ctr]==findEle) return ctr; } } ...r(ctr=0;i<listSize;++ctr){ if(StudentIDs[findEle]==ctr) return findEle; }

LinearSearch(StudentIDs,int listSize,int findEle){ for(ctr=0;i<listSize;++ctr){ if(StudentIDs[ctr]==findEle) return ctr; } }

Which of the following is a valid reason for resizing a hash table? Adding more than 1 item in a bucket Load factor is greater than 0.5 Load factor is less than 0.1 More than 5 items in a hash table

Load factor is greater than 0.5

Which algorithm is best suited for a plagiarism check? Navigation Binary search Shortest path Longest common substring

Longest common substring

Which of the following algorithms has the same best, average, and worst case runtime complexity? Quicksort Merge sort Shell sort Insertion sort

Merge sort

Identify the correct MergeSort function. MergeSort(myList, i, k) { j = 0 if (i < k) { j = (i + k) / 2 Merge(myList, i, j, k) MergeSort(myList, i, j) MergeSort(myList, j + 1, k) } } MergeSort(myList, i, k) { j = 0 if (i > k) { j = (i + k) / 2 MergeSort(myList, i, j) MergeSort(myList, j + 1, k) Merge(myList, i, j, k) } } MergeSort(myList, i, k) { j = 0 if (i < k) { j = (i + k) / 2 MergeSort(myList, i, j) MergeSort(myList, j + 1, k) Merge(myList, i, j, k) } } MergeSort(myList, i, k) { j = 0 if (i < k) { j = (i + k) / 2 MergeSort(myList, i, j) MergeSort(myList, j, k + 1) Merge(myList, i, j + 1, k) } }

MergeSort(myList, i, k) { j = 0 if (i < k) { j = (i + k) / 2 MergeSort(myList, i, j) MergeSort(myList, j + 1, k) Merge(myList, i, j, k) } }

Which of the following is an example of a recursive function? MySalaryCalculator(tempSal) { if (tempSal <= 500) return -1 else tempSal = tempSal + 1000 } MySalaryCalulator(tempSal) { if (tempSal <= 500) return -1 else MySalaryCalculator(tempSal - 500) } MySalaryCalculator(tempSal) { if (tempSal <= 500) return -1 else print(tempSal) } MySalaryCalculator(tempSal) { if (tempSal >= 500) return -1 else tempSal = tempSal + 1000 }

MySalaryCalulator(tempSal) { if (tempSal <= 500) return -1 else MySalaryCalculator(tempSal - 500) }

An algorithm that uses a constant number k of integer variables to find a number list's minimum value has space complexity S(N)= _____ and auxiliary space complexity S(N)= _____. k, k N, N k, N N, k

N, k

What is the Big O notation for the following algorithm? kotlinCopy code ctr = 0 while (ctr < N) { myAge = ctr val = ctr + 1 while (val < N) { if (ageOfPeople[val] < ageOfPeople[myAge]) myAge = val ++val } tempList = ageOfPeople[ctr] ageOfPeople [ctr] = ageOfPeople [myAge] ageOfPeople [myAge] = tempList ++ctr } O(N^2) O(log N) O(N) O(1)

O(N^2)

Which collision resolution technique places the item in another empty bucket? Chaining Open hashing Open addressing Closed addressing

Open addressing

Which XXX completes the Java BinarySearchTree class's remove() method? javaCopy code public boolean remove(int key) { Node parent = null; Node currentNode = root; while (XXX) { // Method implementation } return false; } currentNode == null currentNode != null parent == null parent != null

currentNode != null

What is the space complexity of the algorithm? ArithmeticSeries(list, listSize) { i = 0 arithmeticSum = 0 while (i < listSize) { arithmeticSum = arithmeticSum + list[i] i = i + 1 } return arithmeticSum } S(N) = N S(N) = k S(N) = N + k S(N) = N * k

S(N) = N + k

Identify the notation for algorithm complexity that has a positive constant c for all T(N) >= c * f(N). T(N) = Theta(f(N)) T(N) = O(f(N)) T(N) = Omega(f(N)) T(N) = N(f(N))

T(N)=Omega(f(N))

Which of the following statements is correct? The queue ADT supports the insertion and deletion of items at the front and the back. The list ADT supports the printing of the list contents but the queue ADT does not. The queue ADT supports the removing of items from one end and the adding of items to the other end but the list ADT does not. The queue ADT supports the printing of the list contents but the list ADT does not.

The queue ADT supports the removing of items from one end and the adding of items to the other end but the list ADT does not.

Identify the error in the following code snippet of the quicksort partition function. while (completed) { while (myList[low] < pivot) { ++low } while (pivot < myList[high]) { --high } if (low >= high) completed = true else { temp = myList[low] myList[low] = myList[high] myList[high] = temp ++low --high } } The statement while (pivot < myList[high]) should be while (pivot > myList[high]) The statement myList[low] = myList[high] should be myList[low] = pivot The statement while (completed) should be while (!completed) The statement myList[low] = myList[high] should be myList[high] = myList[low]

The statement while (completed) should be while (!completed)

Which XXX completes the quadratic probing search function? javaCopy code HashSearch(hashTable, key) { i = 0 bucketsProbed = 0 bucket = Hash(key) % N while ((hashTable[bucket] is not EmptySinceStart) and (bucketsProbed < N)) { if ((hashTable[bucket] is Occupied) and (hashTable[bucket]⇢key == key)) return hashTable[bucket] i = i + 1 XXX bucketsProbed = bucketsProbed + 1 } return null } bucket = (Hash(key) + c1 * c2 + i * i * i) / N bucket = (Hash(key) + c1 + i + c2 / i * i) / N bucket = (Hash(key) + c1 / i + c2 / i * i) % N bucket = (Hash(key) + c1 * i + c2 * i * i) % N

bucket = (Hash(key) + c1 * i + c2 * i * i) % N

The Java partition() method creates a left and right partition within an array. After calling partition() for an array, the chosen pivot value _____. can exist in both the array's left partition and the array's right partition can exist only in the array's left partition can exist only in the array's right partition is removed from the array

can exist in both the array's left partition and the array's right partition

Which XXX completes the radixGetMaxLength() Java method such that the method returns the maximum length, in number of digits, out of all elements in the numbers array? intradixGetMaxLength(int[]numbers){ intmaxDigits=0; for(inti=0;i<numbers.length;i++){ intdigitCount=radixGetLength(numbers[i]); if(XXX){ maxDigits=digitCount; } } returnmaxDigits; } numbers[i] > maxDigits digitCount > num digitCount > maxDigits digitCount < maxDigits

digitCount > maxDigits

What will the decrypted word be if the encrypted word is "ezs" after the Caesar cipher with a left shift of 1 is applied? cat fat eat bat

fat

ADTs allow programmers to _____. debug a program focus on higher-level operations as per a program's needs choose the runtime and memory usage of a program access underlying implementation of a program

focus on higher-level operations as per a program's needs

Identify the non-constant time operation. if(x > y) return x; num = arr[i]; arr[i+1] = num+1; for(i = 0; i < 10; i++) sum += num2; i = 0; while(i < listSize) { sum = sum + i; i += 1; }

i = 0; while(i < listSize) { sum = sum + i; i += 1; }

Which XXX will replace the missing conditional statement in the following code for quicksort? Quicksort(numbers, lowIndex, highIndex) { XXX { return } lowEndIndex = Partition(numbers, lowIndex, highIndex) Quicksort(numbers, lowIndex, lowEndIndex) Quicksort(numbers, lowEndIndex + 1, highIndex) } if(lowIndex >= highIndex) if(highIndex > 0) if(lowIndex > 0) if(lowIndex <= highIndex)

if(lowIndex >= highIndex)

The Java mergeSort() method calls merge(), passing the _____ as the last argument. array length index of the partition's last element number of elements in the left partition number of elements in the right partition

index of the partition's last element

A recursive function calls _____. at least two more functions another function itself the main function

itself

Which XXX completes the Java insertionSortInterleaved() method? voidinsertionSortInterleaved(int[]numbers,intstartIndex,intgap){ for(inti=startIndex+gap;i<numbers.length;i+=gap) { intj=i; while(j-gap>=startIndex&&numbers[j]<numbers[j-gap]) { // Swap numbers[j] and numbers [j - 1] inttemp=numbers[j]; numbers[j]=numbers[j-gap]; numbers[j-gap]=temp; XXX } } } j = j + 1; j = j - 1; j = j + gap; j = j - gap;

j = j - gap;

An algorithm that uses a constant number �k of integer variables to find a number list's minimum value has space complexity �(�)=S(N)= _____ and auxiliary space complexity �(�)=S(N)= _____. k, k N, N k, N N, k

k, k

A hash function uses an item's ___ to compute the item's bucket index. bucket key function location

key

Consider a hash table with keys 10, 20, 30, 40, 50, and 60. Which hash function produces the fewest collisions? key % 50 key % 6 key % 10 key % 5

key % 50

A stack abstract data type (ADT) is implemented using a(n) _____ data structure. array linked list heap binary search tree

linked list

Given a list (0, 1, 1, 2, 3, 5, 8, 13, 17) the binary search algorithm calls BinarySearch(list, 0, 8, 5). What will the low and high argument values be for the second recursive call? low = 0, high = 4 low = 5, high = 8 low = 3, high = 8 low = 0, high = 3

low = 5, high = 8

Every object in Java has a hashCode() method that returns an integer that _____. is always negative is always > 0 is always >= 0 may be negative, positive, or 0

may be negative, positive, or 0

When calling the recursive BSTRemoveNode function to remove node 8, a recursive call is made to remove _____. node 4 node 6 node 8 node 9

node 9

A direct access table has the items 21, 32, 43, 54. What will be the output of HashSearch(table, 5)? null 54 0 false

null

In Java, the array { 36, 46, 71, 31, 88, 72 } can be used as input to _____. both the linearSearch() and binarySearch() methods only the linearSearch() method only the binarySearch() method neither the linearSearch() nor the binarySearch() method

only the linearSearch() method

In Java, the array { 36, 46, 71, 31, 88, 72 } can be used as input to _____. only the linearSearch() method both the linearSearch() and binarySearch() methods only the binarySearch() method neither the linearSearch() nor the binarySearch() method

only the linearSearch() method

In a linked list, each node stores a _____ the next node. copy of pointer to child of memory of

pointer to

The LinearProbingHashTable, QuadraticProbingHashTable, and DoubleHashingHashTable Java classes all extend OpenAddressingHashTable and override the _____ method. insert() probe() remove() search()

probe()

Which XXX completes the multiplicative string hash function? javaCopy code HashMultiplicative(string key) { stringHash = InitialValue for (each character strChar in key) { XXX } return stringHash % N } stringHash = (stringHash + HashMultiplier) + strChar stringHash = (stringHash * HashMultiplier) + strChar stringHash = (stringHash + HashMultiplier) * strChar stringHash = (stringHash * HashMultiplier) * strChar

stringHash = (stringHash * HashMultiplier) + strCha

Which XXX completes the multiplicative string hash function? javaCopy code HashMultiplicative(string key) { stringHash = InitialValue for (each character strChar in key) { XXX } return stringHash % N } stringHash = (stringHash + HashMultiplier) + strChar stringHash = (stringHash * HashMultiplier) + strChar stringHash = (stringHash + HashMultiplier) * strChar stringHash = (stringHash * HashMultiplier) * strChar

stringHash = (stringHash * HashMultiplier) + strChar

The Java partition() method used by quicksort selects _____ as the pivot. the array's median value the array's mean value the array's most frequent value the element at the array's midpoint

the element at the array's midpoint

The worst-case runtime of an algorithm is _____ number of steps taken to execute a program. the maximum the minimum the average the optimum

the maximum

Which XXX completes the Java OpenAddressingBucket class's isEmpty() method? javaCopy code boolean isEmpty() { return XXX || this == EMPTY_AFTER_REMOVAL; } this == null this == EMPTY_SINCE_START this != FULL this.key == this.value

this == EMPTY_SINCE_START

During sorting the algorithm swaps _____. the first element with each element two elements at a time the first and middle elements all the elements

two elements at a time

The Java selectionSort() method swaps the smallest element in the _____ portion of the list. unsorted portion of the list with the largest element in the sorted sorted portion of the list with the first element in the unsorted unsorted portion of the list with the first element in the unsorted unsorted portion of the list with the largest element in the unsorted

unsorted portion of the list with the first element in the unsorted

Which XXX would complete the following Java insertion sort algorithm? javaCopy code void insertionSort(int[] numbers) { for (int i = 1; i < numbers.length; i++) { int j = i; XXX { // Swap numbers[j] and numbers[j - 1] int temp = numbers[j]; numbers[j] = numbers[j - 1]; numbers[j - 1] = temp; j--; } } } while (j < 0 && numbers[j] > numbers[j - 1]) while (j > 0 && numbers[j] < numbers[j - 1]) while (numbers[j] < numbers[j - 1] && j > 0) while (j > i && numbers[j] < numbers[i])

while (j > 0 && numbers[j] < numbers[j - 1])

Which XXX completes the Java merge() method in the provided code snippet? ..... XXX { mergedNumbers[mergePos] = numbers[rightPos]; rightPos++; mergePos++;} for (mergePos = 0; mergePos < mergedSize; mergePos++) { numbers[i + mergePos] = mergedNumbers[mergePos];}} while (rightPos <= k) while (mergePos <= mergedSize) while (leftPos <= rightPos) while (i <= k)

while (rightPos <= k)

Identify the constant time operation. while(x > y) x = x + 1; x = array[option]; temp = array[option + 1]; for(i = 0; i < length; i++) sum += i; string str1; string str2; string str3 = concat(str1, str2);

x = array[option]; temp = array[option + 1];

The Java radixSort() method does the most loop iterations when sorting which array? { 21, -99, 99, -15, 0 } { 30, 10, 50, 20, 40 } { 101, 102, 103, 104, 105 } { 90, 80, 70, 60, 50 }

{ 101, 102, 103, 104, 105 }

Assuming "numbers" is an array with 100 items, which array of gap values passed to the Java shellSort() method is likely to have the best performance? { 64, 32, 16, 8, 4, 2, 1 } { 1, 2, 4, 8, 16, 32, 64 } { 1000, 100, 10, 1 } { 1, 10, 100, 1000 }

{ 64, 32, 16, 8, 4, 2, 1 }


Kaugnay na mga set ng pag-aaral

Enterprise Asset Management (EAM)

View Set

Database Foundations Final Practice Test

View Set

Chapter 10. Nursing Care of Patients in Pain

View Set