The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
Facebook Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
Recent questions tagged countingsort
0
votes
1
answer
1
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 into the range $[a..b]$ in $O(1)$ time.Your algorithm should use $\Theta(n+k)$ preprocessing time.
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

54
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
2
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.length Show that the algorithm still works properly. Is the modified algorithm stable?
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

26
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
3
Cormen Edition 3 Exercise 8.2 Question 2 (Page No. 196)
Prove that COUNTINGSORT is stable.
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

20
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
4
Cormen Edition 3 Exercise 8.2 Question 1 (Page No. 196)
COUNTINGSORT(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[i] now contains the number of elements equal to i . 7 for i =1 to k 8 C[i] = C[ ... j] 12 C[A[j]] = C[A[j]]  1 illustrate the operation of COUNTINGSORT on the array $A=\langle 6,0,2,0,1,3,4,6,1,3,2 \rangle $
asked
Jun 28, 2019
in
Algorithms
by
akash.dinkar12
Boss
(
42.7k
points)

32
views
cormen
algorithms
sorting
countingsort
descriptive
To see more, click for the
full list of questions
or
popular tags
.
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Admission Procedure in IIITD
Contesting Answer Key Link Is Live Now
Answer keys are released for Gate2020
My Experience at IIT Madras and Some Insights
GATE Meetup at CSA IISC on February 29 as part of CSA Open Day
Follow @csegate
Recent questions tagged countingsort
Recent Blog Comments
Around 720
Wait 2 to 3 days
Revised ans...
From where is the revised answer key...
true
50,833
questions
57,726
answers
199,451
comments
107,846
users