Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged countingsort
1.7k
views
2
answers
0
votes
Cormen Edition 3 Exercise 8.2 Question 4 (Page No. 197)
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.
akash.dinkar12
1.7k
views
akash.dinkar12
asked
Jun 28, 2019
Algorithms
cormen
algorithms
sorting
countingsort
descriptive
+
–
383
views
0
answers
0
votes
Cormen Edition 3 Exercise 8.2 Question 3 (Page No. 196)
Suppose that we were to rewrite the for loop header in line $10$ of the COUNTINGSORT as 10 for j = 1 to A.lengthShow that the algorithm still works properly. Is the modified algorithm stable?
akash.dinkar12
383
views
akash.dinkar12
asked
Jun 28, 2019
Algorithms
cormen
algorithms
sorting
countingsort
descriptive
+
–
404
views
1
answers
0
votes
Cormen Edition 3 Exercise 8.2 Question 2 (Page No. 196)
Prove that COUNTING-SORT is stable.
akash.dinkar12
404
views
akash.dinkar12
asked
Jun 28, 2019
Algorithms
cormen
algorithms
sorting
countingsort
descriptive
+
–
375
views
0
answers
0
votes
Cormen Edition 3 Exercise 8.2 Question 1 (Page No. 196)
COUNTING-SORT(A, B, k) 1 let C[0, ,k] be a new array 2 for i = 0 to k 3 C[i] = 0 4 for j = 1 to A.length 5 C[A[j]] = C[A[j]] + 1 6 // C ... - 1illustrate the operation of COUNTING-SORT on the array $A=\langle 6,0,2,0,1,3,4,6,1,3,2 \rangle $
akash.dinkar12
375
views
akash.dinkar12
asked
Jun 28, 2019
Algorithms
cormen
algorithms
sorting
countingsort
descriptive
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register