Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An empty hash table has a capacity of 103, and you insert six entries with keys 103, 0, 205, 308, 411, and 2. Using double

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
An empty hash table has a capacity of 103, and you insert six entries with keys 103, 0, 205, 308, 411, and 2. Using double hashing (with hash2(key) returning the value 1 + {key % 101)), where will the 308 be placed in the table? 00 Ol 05 What is the worst-case time for heapsort to sort an array of n elements? O O(log n) O O(n log n) O O(n?) O O(n)Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the array looking like this: 2 5 1 7 9 12 11 10 Which statement is correct? O The pivot is not the 7, but it could be the 9. O The pivot could be either the 7 or the 9. O The pivot could be the 7, but it is not the 9. O Neither the 7 nor the 9 is the pivot.Why is mergesort not a good choice for sorting arrays? O Mergesort is not a good choice for sorting arrays because of the additional running time required for the temporary array in the merge step. Mergesort is not a good choice for sorting arrays because of the additional memory required for the temporary array in the merge step. Mergesort is not a good choice for sorting arrays because of the additional variables declaration required for memory and running time in the merge step. Mergesort is not a good choice for sorting arrays because of the additional delete statement required for the reallocate array memory in the merge step. Mergesort is not a good choice for sorting arrays because of the additional while statements required for more running time in the merge step What would be the best statement about heapsort and selectionsortt? O Heapsort and selectionsort are all interchange algorithm that repeatedly swaps pairs of array elements. Heapsort is locating the largest value, then the next largest, and so on but the selectionsort is not . O Heapsort is interchange algorithm that repeatedly swaps pairs of array elements but the selectionsort is not. Heapsort and selectionsort are all locating the largest value, then the next largest, and so on.O Heapsort is interchange algorithm that repeatedly swaps pairs of array elements but the selectionsort is not. Selectionsort is locating the largest value, then the next largest, and so on but the heapsort is not . O Heapsort and selectionsort are all interchange algorithm that repeatedly swaps pairs of array elements. Heapsort and selectionsort are all locating the largest value, then the next largest, and so on. Heapsort is interchange algorithm that repeatedly swaps pairs of array elements but the selectionsort is not. Heapsort is locating the largest value, then the next largest, and so on but the selectionsort is not .An array contain the following elements, 5 19 13 36 23 2, what would be all the steps of each iteration of insertionsort, using the largest element version of swapping? O 5 19 13 36 23 2 At start 5 19 13 36 23 2 5 13 19 36 23 2 5 13 19 36 23 2 5 13 19 23 36 2 2 5 13 29 23 36 5 19 13 36 23 At start 5 19 13 2 23 36 5 13 19 2 23 36 2 13 19 23 36 2 13 19 23 36 5 13 19 23 36\fIf we have a data array as following, what would be the array after going through the second positions interchange of a quicksort? 40 20 10 80 60 50 7 30 100 90 70 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] O 7 10 20 80 60 50 40 30 100 90 70 [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] O 40 20 10 70 60 50 7 30 80 90 100 [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] O 40 20 10 30 7 50 60 80 100 90 70 [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] O 7 10 40 20 80 60 50 30 100 90 70 [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10) O 40 20 10 80 60 50 7 30 70 90 100 [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]What would be the best function implementation for insertionsort(section 13.1)? O void insertionsort (int data[ ], int n) int i, j; int next; for (i = 1; i 0 & & next data[j-1]) data[j] = data[j-1]; --j; data[j ] = next;O void insertionsort (int data[ ], size tn) size ti, j; int next; for (i = 1; i 0 & & next data[j-1]) data[j] = data[j-1]; --j;O void insertionsort (int data[ ], size t n) size ti, j; int next; for (i = 1; i 0 & & next data[j-1]) data[j] = data[j-1]; --j; data [j ] = next;O void insertionsort (size_data[ ], size t n) size ti, j; int next; for (i = 1; i 0 & & next0 & & next<><><>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions