Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Recent questions tagged cormen
1
vote
1
answer
1
Cormen Edition 3 Exercise 12.1 Question 5 (Page No. 289)
Argue that since sorting $n$ elements takes $\Omega (n\ lgn)$ time in the worst case in the comparison model, any comparison-based algorithm for constructing a $BST$ from an arbitrary list of n elements takes $\Omega (n\ lgn)$ time in the worst case.
KUSHAGRA गुप्ता
asked
in
Algorithms
Nov 20, 2019
by
KUSHAGRA गुप्ता
1.0k
views
cormen
algorithms
descriptive
binary-search-tree
binary-tree
tree
0
votes
1
answer
2
Cormen Edition 3 Exercise 22.2 Question 8 (Page No. 539)
The diameter of a tree $T= (V, E)$ is defined as $max_{u,v\ \epsilon\ V}\ \delta(u,v)$, that is, the largest of all shortest-path distances in the tree. Give an efficient algorithm to compute the diameter of a tree, and analyze the running time of your algorithm.
KUSHAGRA गुप्ता
asked
in
Algorithms
Nov 12, 2019
by
KUSHAGRA गुप्ता
486
views
cormen
graph-algorithms
breadth-first-search
descriptive
1
vote
1
answer
3
Cormen Edition 3 Exercise 22.2 Question 7 (Page No. 539)
There are two types of professional wrestlers: babyfaces ( good guys ) and heels ( bad guys ). Between any pair of professional wrestlers, there may or may not be a rivalry. Suppose we have n professional wrestlers and we ... between a babyface and a heel. If it is possible to perform such a designation, your algorithm should produce it.
KUSHAGRA गुप्ता
asked
in
Algorithms
Nov 12, 2019
by
KUSHAGRA गुप्ता
733
views
cormen
graph-algorithms
breadth-first-search
descriptive
1
vote
1
answer
4
Cormen Edition 3 Exercise 22.2 Question 6 (Page No. 539)
Give an example of a directed graph $G=(V, E)$, a source vertex $s\ \epsilon\ V$ , and a set of tree edges $E_{\Pi}\subseteq E$ such that for each vertex $v\ \epsilon\ V$ ... set of edges $E_{\Pi}$ cannot be produced by running BFS on G, no matter how the vertices are ordered in each adjacency list.
KUSHAGRA गुप्ता
asked
in
Algorithms
Nov 12, 2019
by
KUSHAGRA गुप्ता
740
views
cormen
breadth-first-search
graph-algorithms
descriptive
0
votes
0
answers
5
Cormen Edition 3 Exercise 10.2 Question 8 (Page No. 241)
Explain how to implement doubly linked lists using only one pointer value $x.np$ per item instead of the usual two (next and prev). Assume that all pointer values can be interpreted as $k$-bit integers, and define $x.np$ ... $INSERT$, and $DELETE$ operations on such a list. Also, show how to reverse such a list in $O(1)$ time.
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
538
views
cormen
data-structures
linked-list
descriptive
difficult
0
votes
1
answer
6
Cormen Edition 3 Exercise 10.2 Question 7 (Page No. 241)
Give a $\Theta(n)$ time nonrecursive procedure that reverses a singly linked list of $n$ elements. The procedure should use no more than constant storage beyond that needed for the list itself.
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
461
views
cormen
data-structures
linked-list
descriptive
1
vote
1
answer
7
Cormen Edition 3 Exercise 10.2 Question 6 (Page No. 241)
The dynamic-set operation $UNION$ takes two disjoint sets $S_1$ and $S_2$ as input, and it returns a set $S=S_1 \cup S_2$ consisting of all the elements of $S_1$ and $S_2$.The sets $S_1$ and $S_2$ are usually destroyed by the operation. Show how to support $UNION$ in $O(1)$ time using a suitable list data structure.
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
404
views
cormen
data-structures
linked-list
descriptive
1
vote
1
answer
8
Cormen Edition 3 Exercise 10.2 Question 5 (Page No. 240)
Implement the dictionary operations $INSERT$, $DELETE$, and $SEARCH$ using singly linked, circular lists. What are the running times of your procedures?
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
395
views
cormen
data-structures
linked-list
descriptive
0
votes
0
answers
9
Cormen Edition 3 Exercise 10.2 Question 4 (Page No. 240)
LIST-SEARCH’(L, k) 1 x = L.nil.next 2 while x != L.nil and x.key != k 3 x = x.next 4 return x As written, each loop iteration in the LIST-SEARCH’ procedure requires two tests: one for $x\neq L.nil$ and one for $x.key\neq k$. Show how to eliminate the test for $x\neq L.nil$ in each iteration.
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
255
views
cormen
data-structures
linked-list
descriptive
1
vote
2
answers
10
Cormen Edition 3 Exercise 10.2 Question 3 (Page No. 240)
Implement a queue by a singly linked list $L$. The operations of $ENQUEUE$ and $DEQUEUE$ should still take $O(1)$ time.
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
283
views
cormen
data-structures
linked-list
descriptive
1
vote
1
answer
11
Cormen Edition 3 Exercise 10.2 Question 2 (Page No. 240)
Implement a stack using a singly linked list $L$. The operations $PUSH$ and $POP$ should still take $O(1)$ time.
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
283
views
cormen
data-structures
linked-list
descriptive
0
votes
1
answer
12
Cormen Edition 3 Exercise 10.2 Question 1 (Page No. 240)
Can you implement the dynamic-set operation $INSERT$ on a singly linked list in $O(1)$ time? How about $DELETE$?
akash.dinkar12
asked
in
Algorithms
Jun 30, 2019
by
akash.dinkar12
309
views
cormen
data-structures
linked-list
descriptive
4
votes
2
answers
13
Cormen Edition 3 Exercise 10.1 Question 7 (Page No. 236)
Show how to implement a stack using two queues. Analyze the running time of the stack operations.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
972
views
cormen
data-structures
stack
descriptive
1
vote
2
answers
14
Cormen Edition 3 Exercise 10.1 Question 6 (Page No. 236)
Show how to implement a queue using two stacks. Analyze the running time of the queue operations.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
330
views
cormen
data-structures
queue
descriptive
0
votes
1
answer
15
Cormen Edition 3 Exercise 10.1 Question 5 (Page No. 236)
Whereas a stack allows insertion and deletion of elements at only one end, and a queue allows insertion at one end and deletion at the other end, a deque (double ended queue) allows insertion and deletion at both ends. Write ... time procedures to insert elements into and delete elements from both ends of a deque implemented by an array.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
1.3k
views
cormen
algorithms
data-structures
queue
descriptive
0
votes
1
answer
16
Cormen Edition 3 Exercise 10.1 Question 4 (Page No. 235)
Rewrite ENQUEUE and DEQUEUE to detect underflow and overflow of a queue.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
306
views
cormen
data-structures
queue
descriptive
0
votes
1
answer
17
Cormen Edition 3 Exercise 10.1 Question 3 (Page No. 235)
ENQUEUE(Q, x) 1 Q[Q.tail] = x 2 if Q.tail == Q.length 3 Q.tail = 1 4 else Q.tail = Q.tail + 1 DEQUEUE(Q) 1 x = Q[Q.head] 2 if Q.head == Q.length 3 Q.head = 1 4 else Q.head = Q.head + 1 5 return x illustrate the ... (Q,4),ENQUEUE(Q,1),ENQUEUE(Q,3),DEQUEUE(Q),ENQUEUE(Q,8),DEQUEUE(Q) on an initially empty queue $Q$ stored in array $Q[1...6]$.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
310
views
cormen
data-structures
queue
descriptive
1
vote
1
answer
18
Cormen Edition 3 Exercise 10.1 Question 2 (Page No. 235)
Explain how to implement two stacks in one array $A[1...n]$ in such a way that neither stack overflows unless the total number of elements in both stacks together is $n$.The $PUSH$ and $POP$ operations should run in $O(1)$ time.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
1.7k
views
cormen
data-structures
stack
descriptive
1
vote
1
answer
19
Cormen Edition 3 Exercise 10.1 Question 1 (Page No. 235)
STACK-EMPTY(S) 1 if S.top == 0 2 return TRUE 3 else return FALSE PUSH(S , x) 1 S.top = S.top + 1 2 S[S.top] = x POP(S) 1 if STACK-EMPTY(S) 2 error underflow 3 else S.top = S.top - 1 4 return S[S.top + 1] illustrate the result of ... $S$ stored in array $S[1...6]$
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
387
views
cormen
data-structures
stack
descriptive
0
votes
1
answer
20
Cormen Edition 3 Exercise 9.1 Question 2 (Page No. 215)
Prove the lower bound of $\lceil 3n/2\rceil – 2$ comparisons in the worst case to find both the maximum and minimum of $n$ numbers. (Hint: Consider how many numbers are potentially either the maximum or minimum and investigate how a comparison affects these counts.)
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
583
views
cormen
algorithms
descriptive
0
votes
2
answers
21
Cormen Edition 3 Exercise 9.1 Question 1 (Page No. 215)
Show that the second smallest of $n$ elements can be found with $n+\lceil lg\ n \rceil -2$ comparisons in the worst case. (Hint: Also find the smallest element.)
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
296
views
cormen
algorithms
descriptive
1
vote
0
answers
22
Cormen Edition 3 Exercise 8.4 Question 5 (Page No. 204)
A probability distribution function $P(x)$ for a random variable $X$ is defined by $P(x) =Pr\{X\leq x\}$.Suppose that we draw a list of $n$ random variables $X_1,X_2,…,X_n$ from a continuous probability distribution function $P$ that is computable in $O(1)$ time. Give an algorithm that sorts these numbers in linear averagecase time.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
365
views
cormen
algorithms
sorting
bucket-sort
descriptive
difficult
0
votes
0
answers
23
Cormen Edition 3 Exercise 8.4 Question 4 (Page No. 204)
We are given $n$ points in the unit circle, $P_i=(x_i,y_i)$, such that $0<x_i^2+y_i^2<1$ for $i=1,2, .,n$.Suppose that the points are uniformly distributed; that is, the probability of finding a point in ... the origin. (Hint: Design the bucket sizes in BUCKET-SORT to reflect the uniform distribution of the points in the unit circle.)
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
418
views
cormen
algorithms
sorting
bucket-sort
descriptive
difficult
1
vote
1
answer
24
Cormen Edition 3 Exercise 8.4 Question 3 (Page No. 204)
Let $X$ be a random variable that is equal to the number of heads in two flips of a fair coin. What is $E[X^2]$? What is $E^2[X]$?
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
337
views
cormen
algorithms
sorting
bucket-sort
expectation
descriptive
1
vote
1
answer
25
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)$?
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
433
views
cormen
algorithms
sorting
bucket-sort
descriptive
0
votes
1
answer
26
Cormen Edition 3 Exercise 8.4 Question 1 (Page No. 204)
BUCKET-SORT(A) 1 let B[0...n-1] be a new array 2 n = A.length 3 for i - 0 to n - 1 4 make B[i] an empty list 5 for i = 1 to n 6 insert A[i] into list B[nA[i]] 7 for i = 0 to n - 1 8 sort list B[i] with ... ,B[n-1] together in order illustrate the operation of BUCKET-SORT on the array $A=\langle .79,.13,.16,.64,.39,.20,.89,.53,.71,.42\rangle$
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
307
views
cormen
algorithms
sorting
bucket-sort
descriptive
1
vote
2
answers
27
Cormen Edition 3 Exercise 8.3 Question 4 (Page No. 200)
Show how to sort $n$ integers in the range $0$ to $n^3-1$ in $O(n)$ time.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
776
views
cormen
algorithms
sorting
radix-sort
descriptive
0
votes
0
answers
28
Cormen Edition 3 Exercise 8.3 Question 3 (Page No. 200)
Use induction to prove that radix sort works. Where does your proof need the assumption that the intermediate sort is stable?
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
415
views
cormen
algorithms
sorting
radix-sort
descriptive
0
votes
2
answers
29
Cormen Edition 3 Exercise 8.3 Question 2 (Page No. 200)
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?
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
2.5k
views
cormen
algorithms
sorting
stablesort
descriptive
0
votes
1
answer
30
Cormen Edition 3 Exercise 8.3 Question 1 (Page No. 199)
RADIX-SORT(A, d) 1 for i = 1 to d 2 use a stable sort to sort array A on digit i illustrate the operation of RADIX-SORT on the following list of English words: COW, DOG, SEA, RUG, ROW, MOB, BOX, TAB, BAR, EAR, TAR, DIG, BIG, TEA, NOW, FOX.
akash.dinkar12
asked
in
Algorithms
Jun 28, 2019
by
akash.dinkar12
954
views
cormen
algorithms
sorting
radix-sort
descriptive
Page:
1
2
3
4
5
6
7
next »
Subscribe to GATE CSE 2023 Test Series
Subscribe to GO Classes for GATE CSE 2023
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
Central Pollution Control Board CPCB Various Post Recruitment 2023
MP Rajya Sahkari Apex Bank Various Post Recruitment 2023
NITIE MUMBAI throgh GATE
PGCIL recruitment 2023 – Apply Online For 138 Posts through GATE
Admission guidance for GATE CSE 2023
Subjects
All categories
General Aptitude
(2.6k)
Engineering Mathematics
(9.4k)
Digital Logic
(3.3k)
Programming and DS
(5.9k)
Algorithms
(4.6k)
Theory of Computation
(6.7k)
Compiler Design
(2.3k)
Operating System
(5.0k)
Databases
(4.6k)
CO and Architecture
(3.8k)
Computer Networks
(4.7k)
Non GATE
(1.3k)
Others
(2.5k)
Admissions
(655)
Exam Queries
(847)
Tier 1 Placement Questions
(17)
Job Queries
(77)
Projects
(9)
Unknown Category
(866)
Recent questions tagged cormen
Recent Blog Comments
Unfortunately there won't be a hardcopy coming...
this book is not available on amazon now, i want...
Yes
Hi! @AnkitMazumder14 bhaiya,Is python...
No bachelor degree must be in CS/IT