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 algorithms
Webpage for Algorithms
+1
vote
0
answers
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 comparisonbased algorithm for constructing a $BST$ from an arbitrary list of n elements takes $\Omega (n\ lgn)$ time in the worst case.
asked
Nov 20
in
Algorithms
by
Kushagra गुप्ता
Active
(
1.9k
points)

76
views
cormen
algorithms
descriptive
binarysearchtree
binarytree
trees
0
votes
2
answers
2
Understanding Nphard
I am having difficulty in understanding np and nphard topic in algorithms. If someone can provide some good source to learn about it in easy manner it would be a real help. Thank you!
asked
Sep 22
in
Algorithms
by
luc_Bloodstone
(
85
points)

93
views
pnpnpcnph
algorithms
+1
vote
1
answer
3
CMI2019B6
Let $A$ be an $n\times n $ matrix of integers such that each row and each column is arranged in ascending order. We want to check whether a number $k$ appears in $A.$ If $k$ is present, we should report its position  that is, the row $i$ and ... $A.$ Justify the complexity of your algorithm. For both algorithms, describe a worstcase input where $k$ is present in $A.$
asked
Sep 13
in
Algorithms
by
gatecse
Boss
(
16.8k
points)

18
views
cmi2019
algorithms
matrices
descriptive
poof
nongate
0
votes
0
answers
4
CMI2019B7
A college professor gives several quizzes during the semester, with negative marking. He has become bored of the usual "Best $M$ out of $N$ quizzes" formula to award marks for internal assessment. Instead, each student will be evaluated ... , the score the professor needs to award each student. Describe the space and time complexity of your dynamic programming algorithm.
asked
Sep 13
in
Algorithms
by
gatecse
Boss
(
16.8k
points)

21
views
cmi2019
algorithms
dynamicprogramming
descriptive
nongate
0
votes
2
answers
5
QUICK SORT SELF DOUBT
In quick sort for sorting of n Numbers, the 75th greatest Element is selected as pivot using $O(n^2)$ time complexity algorithm than what is the worst case time complexity of quick sort. O($n^2$) O($n^3$) O(nlogn) O(n)
asked
Sep 2
in
Algorithms
by
ajaysoni1924
Boss
(
10.5k
points)

194
views
algorithms
divideandconquer
quicksort
0
votes
1
answer
6
IIIT BLR TEST 1 : ALGORITHMS 2
A 3 way (ternary) min heap is a 3 way ( ternary  each node as atmost three children nodes, left, mid, right ) complete tree with min heap property ( value of the parent is less than the value of the children ) satisfied at every node ... c) In Heapsort, binary heap is preferred over ternary heap. State if this statement is true or false, you must justify your answer.
asked
Aug 27
in
Algorithms
by
Shaik Masthan
Veteran
(
64.6k
points)

97
views
iiit_blr
test_1
algorithms
heap
0
votes
1
answer
7
IIIT BLR TEST 1 : ALGORITHMS 1
Solve the following recursions ( in terms of Θ ). T(0) = T(1) = Θ(1) in all of the following. $T(n) = n + \frac{1}{n}\sum_{i=0}^{i=n1}T(i)$ $T(n) = n + \frac{2}{n}\sum_{i=0}^{i=n1}T(i)$ $T(n) = n + \frac{4}{n}\sum_{i=0}^{i=n/2}T(i)$ $T(n) = n + \frac{40}{n}\sum_{i=0}^{i=n/5}T(i)$
asked
Aug 27
in
Algorithms
by
Shaik Masthan
Veteran
(
64.6k
points)

116
views
iiit_blr
test_1
algorithms
timecomplexity
0
votes
1
answer
8
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.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

43
views
cormen
algorithms
datastructure
queues
descriptive
0
votes
1
answer
9
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.)
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

21
views
cormen
algorithms
descriptive
0
votes
1
answer
10
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.)
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

27
views
cormen
algorithms
descriptive
0
votes
0
answers
11
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.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

64
views
cormen
algorithms
sorting
bucketsort
descriptive
difficult
0
votes
0
answers
12
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 BUCKETSORT to reflect the uniform distribution of the points in the unit circle.)
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

25
views
cormen
algorithms
sorting
bucketsort
descriptive
difficult
0
votes
1
answer
13
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]$?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

29
views
cormen
algorithms
sorting
bucketsort
expectation
descriptive
0
votes
0
answers
14
Cormen Edition 3 Exercise 8.4 Question 2 (Page No. 204)
Explain why the worstcase running time for bucket sort is $\Theta(n^2)$. What simple change to the algorithm preserves its linear averagecase running time and makes its worstcase running time $O(n\ lg\ n)$?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

20
views
cormen
algorithms
sorting
bucketsort
descriptive
0
votes
1
answer
15
Cormen Edition 3 Exercise 8.4 Question 1 (Page No. 204)
BUCKETSORT(A) 1 let B[0...n1] 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[n1] together in order illustrate the operation of BUCKETSORT on the array $A=\langle .79,.13,.16,.64,.39,.20,.89,.53,.71,.42\rangle$
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

33
views
cormen
algorithms
sorting
bucketsort
descriptive
+1
vote
1
answer
16
Cormen Edition 3 Exercise 8.3 Question 4 (Page No. 200)
Show how to sort $n$ integers in the range $0$ to $n^31$ in $O(n)$ time.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

50
views
cormen
algorithms
sorting
radixsort
descriptive
0
votes
0
answers
17
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?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

15
views
cormen
algorithms
sorting
radixsort
descriptive
0
votes
2
answers
18
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?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

33
views
cormen
algorithms
sorting
stablesort
descriptive
0
votes
1
answer
19
Cormen Edition 3 Exercise 8.3 Question 1 (Page No. 199)
RADIXSORT(A, d) 1 for i = 1 to d 2 use a stable sort to sort array A on digit i illustrate the operation of RADIXSORT on the following list of English words: COW, DOG, SEA, RUG, ROW, MOB, BOX, TAB, BAR, EAR, TAR, DIG, BIG, TEA, NOW, FOX.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

22
views
cormen
algorithms
sorting
radixsort
descriptive
0
votes
0
answers
20
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)

23
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
21
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)

11
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
22
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)

14
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
23
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)

17
views
cormen
algorithms
sorting
countingsort
descriptive
0
votes
0
answers
24
Cormen Edition 3 Exercise 8.1 Question 4 (Page No. 194)
Suppose that you are given a sequence of $n$ elements to sort.The input sequence consists of $n/k$ subsequences, each containing $k$ elements.The elements in a given subsequence are all smaller than the elements in the ... of the sorting problem. (Hint: It is not rigorous to simply combine the lower bounds for the individual subsequences.)
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

25
views
cormen
algorithms
sorting
descriptive
0
votes
0
answers
25
Cormen Edition 3 Exercise 8.1 Question 3 (Page No. 194)
Show that there is no comparison sort whose running time is linear for at least half of the $n!$ inputs of length $n$.What about a fraction of $1/n$ inputs of length $n$? What about a fraction $1/2^n$?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

16
views
cormen
algorithms
sorting
descriptive
0
votes
1
answer
26
Cormen Edition 3 Exercise 8.1 Question 2 (Page No. 194)
Obtain asymptotically tight bounds on $lg\ (n!)$ without using Stirling’s approximation. Instead, evaluate the summation $\sum_{k=1}^{n} lg\ k$.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

20
views
cormen
algorithms
asymptoticnotations
descriptive
0
votes
1
answer
27
Cormen Edition 3 Exercise 8.1 Question 1 (Page No. 193)
What is the smallest possible depth of a leaf in a decision tree for a comparison sort?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

22
views
cormen
algorithms
sorting
descriptive
0
votes
1
answer
28
Cormen Edition 3 Exercise 7.4 Question 6 (Page No. 185)
Consider modifying the PARTITION procedure by randomly picking three elements from the array $A$ and partitioning about their median (the middle value of the three elements). Approximate the probability of getting at worst a $\alpha$to$(1\alpha)$ split, as a function of $\alpha$ in the range $0<\alpha<1$.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

26
views
cormen
algorithms
quicksort
descriptive
difficult
0
votes
1
answer
29
Cormen Edition 3 Exercise 7.4 Question 5 (Page No. 185)
We can improve the running time of quicksort in practice by taking advantage of the fast running time of insertion sort when its input is nearly sorted. Upon calling quicksort on a subarray with fewer than $k$ elements, let it simply return without ... $k$, both in theory and in practice?
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

19
views
cormen
algorithms
quicksort
descriptive
0
votes
1
answer
30
Cormen Edition 3 Exercise 7.4 Question 4 (Page No. 184)
Show that RANDOMIZEDQUICKSORT’s expected running time is $\Omega(n\ lg\ n)$.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.9k
points)

61
views
cormen
algorithms
quicksort
timecomplexity
descriptive
Page:
1
2
3
4
5
6
...
83
next »
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 algorithms
Recent Blog Comments
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...
it'll take 34 days but for most purpose you can...
50,648
questions
56,441
answers
195,294
comments
100,083
users