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
Cormen Edition 3 Exercise 8.2 Question 2 (Page No. 196)
0
votes
15
views
Prove that
COUNTING-SORT
is stable.
cormen
algorithms
sorting
countingsort
descriptive
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)
|
15
views
answer
comment
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
0
Answers
← Prev. Qn. in Sub.
Next Qn. in Sub. →
← Prev.
Next →
Related questions
0
votes
0
answers
1
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)
|
12
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
2
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[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 COUNTING-SORT 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)
|
18
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
3
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)
|
25
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
4
Cormen Edition 3 Exercise 8.4 Question 2 (Page No. 204)
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)$?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)
|
21
views
cormen
algorithms
sorting
bucketsort
descriptive
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
All categories
General Aptitude
1.9k
Engineering Mathematics
7.5k
Digital Logic
2.9k
Programming and DS
4.9k
Algorithms
4.3k
Theory of Computation
6.2k
Compiler Design
2.1k
Operating System
4.5k
Databases
4.1k
CO and Architecture
3.4k
Computer Networks
4.1k
Non GATE
1.5k
Others
1.5k
Admissions
595
Exam Queries
576
Tier 1 Placement Questions
23
Job Queries
72
Projects
17
Follow @csegate
Recent Blog Comments
It's a question not a post..
i also don't have any pdf, actually, I added the...
i don't have , if you have upload it
@mohan123 Do you have all standard book...
bro can be upload all standard book questions in...
50,647
questions
56,492
answers
195,439
comments
100,696
users