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
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged algorithms
Webpage for Algorithms
0
votes
0
answers
1
Discrete mathematics 7th ed by Kenneth Rosen,chapter3:Algorithm
Should not there be a second condition stating i = j1 in While loop's conditional statement,if not then it seems to me while loop will be a infinite loop..
asked
Jun 12
in
Algorithms
by
souren
(
37
points)

68
views
discretemathematics
algorithms
sorting
0
votes
1
answer
2
Master's Theorem: Validity of Format
How to check if a given recurrence relation is in a format that is valid to apply Master’s Theorem? Also, how to distinguish between Master’s Theorem and extended Master’s Theorem?
asked
Jun 12
in
Algorithms
by
lolster
(
223
points)

61
views
algorithms
mastertheorem
timecomplexity
asymptoticnotations
+1
vote
0
answers
3
GATE1999
Consider the following algorithms. Assume, procedure $A$ and procedure $B$ take $O(1)$ and $O(1/n)$ unit of time respectively. Derive the time complexity of the algorithm in $O$ notation. algorithm what (n) begin if n = 1 then call A else begin what (n1); call B(n ... $c$ So complexity should be $O(1)$. But answer is $O(n)$.What I am doing wrong?
asked
Jun 4
in
Algorithms
by
kshitij
(
85
points)

90
views
algorithms
timecomplexity
recurrence
0
votes
1
answer
4
AlgorithmSelf Doubt
How in a heap there are at most $\lceil \frac{n}{2^{h+1}} \rceil$ nodes of height h.
asked
Jun 3
in
Algorithms
by
Ayush Upadhyaya
Boss
(
24.5k
points)

43
views
algorithms
selfdoubt
0
votes
1
answer
5
Doubt on Bipartite Graph
What is T.C. to find maximum number of edges to be added to a tree so that it stays as a bipartite graph? Now my question is, why do we need to add edges to make a tree bipartite? A tree is already bipartite graph. Right?? Again how do we add edges in it?? Is BFS or DFS do any improvement in such a tree?? How to think such a question??
asked
Jun 2
in
Algorithms
by
srestha
Veteran
(
111k
points)

39
views
graphtheory
algorithms
0
votes
0
answers
6
Self Doubt:Infinite loop
#include<iostream> using namespace std; int i=0; void a() { i+=1; cout<<i<< ".hello"<<endl; a(); } int main() { a(); } For this above code the output is only upto → 64891.Hello Does this mean that that the stack can hold only 64891 recursive calls? (I am using dev c++)
asked
Jun 2
in
Programming
by
Hirak
Active
(
3k
points)

47
views
algorithms
programminginc
recursion
+3
votes
1
answer
7
asymptotic_Notations Self_Doubt
Please give an example case for which all the three conditions $f(n)\neq O(g(n))$, $f(n)\neq \Theta (g(n))$ and $f(n)\neq \Omega (g(n))$ holds true.
asked
Jun 1
in
Algorithms
by
Satbir
Boss
(
13.2k
points)

158
views
asymptoticnotations
selfdoubt
algorithms
0
votes
1
answer
8
Probability question of CLRS
In a restaurant each of $n$ customer gives a hat to the hat check person. The hat check person gives the hat back to the customer in a random order. What is expected number of customer who get back their own hat?
asked
May 27
in
Probability
by
srestha
Veteran
(
111k
points)

88
views
algorithms
probability
0
votes
0
answers
9
#CLRS #Algorithm Doubt about randomized QuickSort.
asked
May 27
in
Algorithms
by
iarnav
Loyal
(
7.9k
points)

78
views
algorithms
sortingalgorithmsquicksort
sorting
asymptoticnotations
0
votes
1
answer
10
Asymptotic Notation theta property
If $T1(n) = \Theta(f(n))$ & $T2(n) = \Theta(f(n))$ Then, Is $T1(n) + T2(n) = O(f(n))$ If yes, then how?
asked
May 26
in
Algorithms
by
shubhojit1412
(
5
points)

91
views
asymptoticnotations
algorithms
timecomplexity
growthrate
0
votes
2
answers
11
Made easy Workbook 2020
Question: $T(1)=1$ $T(n) = 2 T(n  1) + n$ evaluates to? Can anyone solve it by substitution method? Given answer $T(n) = 2^{n+1}  (n+2)$ How?
asked
May 25
in
Algorithms
by
Jyoti Kumari97
(
175
points)

123
views
timecomplexity
algorithms
recurrenceeqation
+1
vote
1
answer
12
#Algorithms QuickSort Algorithm Doubt regarding pivot and analysis.
asked
May 22
in
Algorithms
by
iarnav
Loyal
(
7.9k
points)

91
views
algorithms
sorting
+2
votes
1
answer
13
Vani Qs Bank Algorithms
.Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]=i. Ans should be O(log n) right by doing binary search ??
asked
May 21
in
Algorithms
by
Hirak
Active
(
3k
points)

96
views
algorithms
datastructure
arrays
searching
+2
votes
0
answers
14
GEEKSFORGEEKS ALGO
What does it mean when we say that an algorithm X is asymptotically more efficient than Y? (A) X will be a better choice for all inputs (B) X will be a better choice for all inputs except small inputs (C) X will be a better choice for all inputs except large ... is it always the case?? At some points it might be true but I do not think this is the case for each and every input..
asked
May 20
in
Algorithms
by
Hirak
Active
(
3k
points)

53
views
algorithms
0
votes
0
answers
15
Recurrence RelationSelf Doubt(Discrete Math+Algo)
Let $A(n)$ denotes the number of $n$ bit binary strings which have no pair of consecutive $1’s.$ what will be recurrence relation for it and what will be it’s Time Complexity??
asked
May 19
in
Algorithms
by
srestha
Veteran
(
111k
points)

54
views
discretemathematics
recurrenceeqation
algorithms
0
votes
0
answers
16
Made Easy Test Series:AlgorithmDijkstra
Which of the following procedure results same output as Dijkstra’s Algo. on unweighted graph on $'n'$ verices? $A)$ BFS $B)$ DFS $C)$Kruskal $D)$ Prims As far I know Dijkstra and Prims both have $T.C.=O(E+VlogV)$ But ans given BFS. How this ans possible??
asked
May 18
in
Algorithms
by
srestha
Veteran
(
111k
points)

41
views
madeeasytestseries
algorithms
+1
vote
0
answers
17
Made Easy Test Series:AlgorithmTime Complexity
Consider a procedure $find()$ which take array of $n$ integers as input, and produce pair of element of array whose difference is not greater than the difference of any other pair of element of that array. Which of the following represent ... Here we need to sort first and then need to compare adjacent element right?? Then what will be complexity??
asked
May 18
in
Algorithms
by
srestha
Veteran
(
111k
points)

75
views
algorithms
madeeasytestseries
timecomplexity
0
votes
0
answers
18
Made Easy Test Series: AlgorithmReverse Polish Notation
Consider the neworder strategy for traversing a binary tree: Visit the root Visit the right subtree using neworder Visit the left subtree using neworder The neworder traversal of expression tree corresponding to the reverse polish expression 3 4 * 5 – 2 ^ 6 7 * 1 + – What will be expression, any procedure for it??
asked
May 16
in
Compiler Design
by
srestha
Veteran
(
111k
points)

76
views
infixpostfix
algorithms
timecomplexity
0
votes
0
answers
19
Made Easy Test Series: AlgorithmSorting
An array $A$ of size n is known to be sorted except for the first $k$ elements and the last $k$ elements, where $k$ is a constant. Which of the following algorithms will be the best choice for sorting the array $A?$ $a)$ ... sorts part by part using pivot. So, why not will it be answer?? How do we know it is asking for almost sorted array??
asked
May 12
in
Algorithms
by
srestha
Veteran
(
111k
points)

75
views
algorithms
madeeasytestseries
sorting
0
votes
0
answers
20
ISI2018PCBB5
Consider a maxheap of $n$ distinct integers, $n ≥ 4$, stored in an array $\mathcal{A}[1 . . . n]$. The second minimum of $\mathcal{A}$ is the integer that is less than all integers in $\mathcal{A}$ except the minimum of $\mathcal{A}$. Find all possible array indices of $\mathcal{A}$ in which the second minimum can occur. Justify your answer.
asked
May 12
in
Algorithms
by
akash.dinkar12
Boss
(
40.5k
points)

16
views
isi2018pcbb
algorithms
algorithmdesign
heap
descriptive
0
votes
1
answer
21
ISI2018PCBB2
You can climb up a staircase of $n$ stairs by taking steps of one or two stairs at a time. Formulate a recurrence relation for counting $a_n$, the number of distinct ways in which you can climb up the staircase. Mention the boundary conditions for your recurrence relation. Find a closed form expression for $a_n$ by solving your recurrence.
asked
May 12
in
Algorithms
by
akash.dinkar12
Boss
(
40.5k
points)

30
views
isi2018pcbb
algorithms
recurrenceeqation
descriptive
0
votes
0
answers
22
ISI2018PCBB1
Consider an array of length n consisting only of positive and negative integers. Design an algorithm to rearrange the array so that all the negative integers appear before all the positive integers, using $O(n)$ time and only a constant amount of extra space.
asked
May 12
in
Algorithms
by
akash.dinkar12
Boss
(
40.5k
points)

11
views
isi2018pcbb
algorithms
algorithmdesign
descriptive
0
votes
1
answer
23
Made Easy Test Series:Algorithm Minimum Weight Path
Consider the following statement: $A)$ If all edge weight of a graph are positive then any subset of edges that connect all vertices and has minimum total weight is a tree. $B)$ ... minimum weight graph?? and what about B)?? Is it just saying each minimum path between $2$ vertices makes total shortest path??
asked
May 10
in
Algorithms
by
srestha
Veteran
(
111k
points)

30
views
algorithms
madeeasytestseries
0
votes
2
answers
24
Made Easy Test Series:AlgorithmInversion
Consider an array $A=\left \{ 30,15,48,34,26,29 \right \}$ Let $X$ be the number of inversion of array $A,$ Now another array $B$ is constructed by making all the numbers in $A$ negative and keeping the order between each numbers same. Let the ... array so obtained be $Y.$ Then $X+2Y=$_______________ $\left ( 30,26 \right )$ number of inversion $4$ or $1??$
asked
May 10
in
Algorithms
by
srestha
Veteran
(
111k
points)

25
views
madeeasytestseries
algorithms
0
votes
1
answer
25
Made Easy Test Series:AlgorithmRecurrence Relation
What is the solution of recurrence relation $T\left ( n \right )=T\left ( n1 \right )+n$
asked
May 10
in
Algorithms
by
srestha
Veteran
(
111k
points)

93
views
algorithms
timecomplexity
recurrenceeqation
+1
vote
0
answers
26
GO screening test
Which one of the following notations is most relevant for finding the best algorithm for a problem? (A) $o(f(n))$ (B) $O(f(n))$ (C) $\omega (f(n))$ (D) $ \Omega (f(n))$
asked
May 9
in
Algorithms
by
toxicdesire
Junior
(
791
points)

122
views
timecomplexity
algorithms
goscreeningtest
0
votes
1
answer
27
Made Easy Test Series:AlgorithmMathematical Solution
Consider a hash table with $n$ slots that uses chaining for collision resolution, table is initially empty. What is the probability that after $4$ keys are inserted then atleast a chain of size $3$ is created, when the value of $n=9$___________ They have done ... $3??$ Plz chk it
asked
May 8
in
Algorithms
by
srestha
Veteran
(
111k
points)

23
views
madeeasytestseries
algorithms
0
votes
1
answer
28
Made Easy Test Series:Time Complexity
Consider the following program: int Bar(int n){ if(n<2) return; } else{ int sum=0; int i,j; for(i=1;i<=4;i++) Bar(n/2); for(i=1;i<=n;i++){ for(j=1;j<=i;j++){ sum=sum+1; } } } Now consider the following ... $Bar\left ( n \right )$ is $O \left ( n^{3}logn^{2} \right )$ How many statements are correct________________
asked
May 7
in
Algorithms
by
srestha
Veteran
(
111k
points)

198
views
madeeasytestseries
algorithms
timecomplexity
0
votes
2
answers
29
Made Easy Test Series: Algo Mathematical Solution
Through an experiment, it is found that selection sort performs $5000$ comparisons when sorting an array of size $k.$ If the size of array is doubled, what will be the number of comparisons? will it be $\left ( 5000 \right )^{2}$ or $\left ( 5000 \right )\times 4$. Someone check plz
asked
May 6
in
Algorithms
by
srestha
Veteran
(
111k
points)

35
views
madeeasytestseries
algorithms
0
votes
2
answers
30
Made Easy Test Series:Algo Asymptotic Complexity
$1)n^{2019}=O\left (n^{2020} \right )$ $2)O(n^{2019})=O\left (n^{2020} \right )$ Which one is correct?? If $1)$ is correct, why $2)$ not correct?
asked
May 6
in
Algorithms
by
srestha
Veteran
(
111k
points)

135
views
madeeasytestseries
algorithms
Page:
1
2
3
4
5
6
...
80
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
IIITH Preparation and interview experience (M.Tech CSE)
My Journey To iiiTH Mtech Cse 2019
IIIT H INTERVIEW EXPERIENCE 2019
IIITH Interview Experience
Thanks GO!!
Follow @csegate
Recent questions tagged algorithms
Recent Blog Comments
Sir till when i cn get my GO 2020 hardcopy. I cnt...
Wonderful experience bro! Something different...
Congrats
Delivery is not beyond July 15 for first 200...
for address change, to whom we have to mail? As I...
49,548
questions
54,169
answers
187,463
comments
71,120
users