subject
Mathematics, 12.12.2019 00:31 chasityn5648

Consider the bucket sort algorithm. the pseudocode1 for bucket sort is given below. bucket-sort(a) 1 2 3 4 5 6 7 8 9 10 (a) (b) n = a. length let b[0..n−1] be an empty array fori=0ton−1 make b[i] an empty list fori=0ton−1 insert a[i] into list b[hash(a[i])] / hashing function determines which bucket element goes into fori=0ton−1 sort list b[i] with insertion sort concatenate the lists b[0], b[1], . . , b[n − 1] together in order argue that the worst-case running time for bucket sort is o(n2). provide a scenario in which this happens. [5 pts] by replacing insertion sort with a more efficient mergesort or heapsort in line 9 of the pseudocode, bucketsort can achieve a worst-case running time of o(nlogn) instead of o(n2). argue why switching insertion sort to a more "efficient" sort is not a good idea. hint: when would you use bucket sort in the first place? [5pts]

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 21.06.2019 12:50
What's the difference between: x≥0 and nonnegative integer. ?
Answers: 2
question
Mathematics, 21.06.2019 14:30
An eight-sided die, which may or may not be a fair die, has four colors on it; you have been tossing the die for an hour and have recorded the color rolled for each toss. what is the probability you will roll a brown on your next toss of the die? express your answer as a simplified fraction or a decimal rounded to four decimal places.
Answers: 2
question
Mathematics, 21.06.2019 20:50
Type the correct answer in each box, round your answers to the nearest integer 20 25 30 in the figure, the perimeter of hexagon abcdef is approximately w units, and its area is square units
Answers: 3
question
Mathematics, 21.06.2019 23:00
Can someone me with my math problems i have a bunch. i will give brainliest and lots of pleeeaaasssee
Answers: 2
You know the right answer?
Consider the bucket sort algorithm. the pseudocode1 for bucket sort is given below. bucket-sort(a) 1...
Questions
question
Computers and Technology, 26.06.2019 06:30