624 views

Please log in or register to answer this question.

Related questions

1.8k
views
1 answers
1 votes
akash.dinkar12 asked Jun 26, 2019
1,842 views
Using Figure $2.4$ as a model, illustrate the operation of merge sort on the array $A=\langle 3,41,52,26,38,57,9,49 \rangle $
734
views
1 answers
1 votes
akash.dinkar12 asked Jun 28, 2019
734 views
Explain why the worst-case running time for bucket sort is $\Theta(n^2)$. What simple change to the algorithm preserves its linear average-case running time and makes its worst-case running time $O(n\ lg\ n)$?
3.5k
views
2 answers
0 votes
akash.dinkar12 asked Jun 28, 2019
3,525 views
Which of the following sorting algorithms are stable: insertion sort, merge sort, heapsort, and quicksort? Give a simple scheme that makes any sorting algorithm stable. How much additional time and space does your scheme entail?
1.7k
views
2 answers
0 votes
akash.dinkar12 asked Jun 28, 2019
1,724 views
Describe an algorithm that, given $n$ integers in the range $0$ to $k$ preprocesses its input and then answers any query about how many of the $n$ integers fall ... in $O(1)$ time.Your algorithm should use $\Theta(n+k)$ preprocessing time.