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
0
answers
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
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

26
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
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

13
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
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

16
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
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

19
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
Linear Algebra Important Points
GATE 2020
OFFICIAL GATE MOCK TEST RELEASED
IIITH: Winter Research Admissions 2019 (For Spring 2020)
TIFR and JEST exam
Follow @csegate
Recent questions tagged countingsort
Recent Blog Comments
Lakshman Patel RJIT Do you have such notes...
Great work sir
Yes Sir, It will be very helpful if we get...
@arjun sir is there a pdf...
Really helpful sir Thanks a tonππ
50,645
questions
56,549
answers
195,696
comments
101,554
users