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 and answers in Algorithms
1
vote
1
answer
1
made easy test series
How is the max possible value of n is 12? We will have to store T(0) and T(1) in stack too, so we can call f(11) at max which will require T(10) and T(9) and then we will store f(11) in stack. But if we call f(12) we wont be able to store it as overflow will occur.
afroze
answered
in
Algorithms
3 hours
ago
by
afroze
57
views
made-easy-test-series
stack
algorithms
dynamic-programming
71
votes
14
answers
2
GATE CSE 2014 Set 1 | Question: 39
The minimum number of comparisons required to find the minimum and the maximum of $100$ numbers is ________
swami_9
answered
in
Algorithms
8 hours
ago
by
swami_9
43.1k
views
gatecse-2014-set1
algorithms
numerical-answers
normal
maximum-minimum
52
votes
11
answers
3
GATE CSE 2012 | Question: 39
A list of $n$ strings, each of length $n$, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is $O (n \log n) $ $ O(n^{2} \log n) $ $ O(n^{2} + \log n) $ $ O(n^{2}) $
Pranavpurkar
answered
in
Algorithms
2 days
ago
by
Pranavpurkar
23.0k
views
gatecse-2012
algorithms
sorting
normal
3
votes
3
answers
4
unacademy combat
what will be time complexity of this program? void function(int n) { int count = 0; for (int i=0; i<n; i++) { for (int j=1; j< i*i; j++) { if (j%i == 0) { for (int k=0; k<j; k++) printf("*"); } } } }
Argharupa Adhikary
answered
in
Algorithms
4 days
ago
by
Argharupa Adhikary
336
views
algorithms
time-complexity
unacademy-combat
0
votes
3
answers
5
Self doubt.
What is the time & space complexity of this algorithm? Main() { for(i=n; i>10; i=i^1/4) { for(j=201; j<n^3; j=j+400) { for(k=47; k<=n^84; k=k*108) { k=k^61; } } } }
Nisha Bharti
answered
in
Algorithms
5 days
ago
by
Nisha Bharti
82
views
algorithms
time-complexity
space-complexity
self-doubt
0
votes
0
answers
6
Recurrence relationship
T(n) = 3T(n-1) -4T(n-2) + 2T(n-3) If n = 0 then T(n) = 1 if n= 1 or 2 then T(n) = 0 What is the generalized solution?
kumar123
asked
in
Algorithms
5 days
ago
by
kumar123
80
views
algorithms
recurrence-relation
0
votes
2
answers
7
igate Test Series
Rahul knows the implementation of merge sort. One day, his teacher asked him to find numbers of inversion in an array. An inversion can be defined in an array as if i < j, a[i] > a[j] then it is an inversion. Now, given there are p inversions in an ... multiply all elements by -1, what is the time complexity to find inversions in an updated array? O(n) O(nlogn) O(n^2) None
Shubham Sharma 2
answered
in
Algorithms
Sep 23
by
Shubham Sharma 2
76
views
algorithms
array-inversion
i-gate-test-series
1
vote
1
answer
8
question on Big O and theta notation
d_siddhesh
answered
in
Algorithms
Sep 23
by
d_siddhesh
909
views
7
votes
2
answers
9
TIFR CSE 2013 | Part B | Question: 15
Let $G$ be an undirected graph with $n$ vertices. For any subset $S$ of vertices, the set of neighbours of $S$ consists of the union of $S$ and the set of vertices $S'$ that are connected to some vertex in $S$ by an edge of $G$. The graph $G$ has the nice property ... $O \left(\sqrt{n}\right)$ but not $O (\log n)$ $O (n)$ but not $O \left(\sqrt{n}\right)$
shishir__roy
answered
in
Algorithms
Sep 16
by
shishir__roy
856
views
tifr2013
graph-algorithms
0
votes
1
answer
10
Cormen Edition 3 Exercise 11.4 Question 3 (Page No. 277)
Consider an open-address hash table with uniform hashing. Give upper bounds on the expected number of probes in an unsuccessful search and on the expected number of probes in a successful search when the load factor is $3/4$ and when it is $7/8$.
shub2204
answered
in
Algorithms
Sep 15
by
shub2204
244
views
cormen
algorithms
hashing
descriptive
0
votes
2
answers
11
Cormen Edition 3 Exercise 3.1 Question 3 (Page No. 53)
Explain why the statement, “The running time of algorithm A is at least $O(n^2),$” is meaningless.
Vishal_kumar98
answered
in
Algorithms
Sep 12
by
Vishal_kumar98
232
views
cormen
algorithms
asymptotic-notations
descriptive
0
votes
1
answer
12
Applied Test
Which of the following are applications for DFS when we have an unweighted directed graph at hand. 1.Single source shortest path from the source vertex. 2 Topological sorting of the vertices 3 Strongly connected components of the graph. 4 Detection of cycles in the graph. Can we use unweighted directed graph in Topological sorting ?? .
DebSujit
answered
in
Algorithms
Sep 9
by
DebSujit
100
views
graph-algorithms
data-structures
test-series
0
votes
0
answers
13
Time complexity
1. for ( i = 1 ; i <= n ; i++) { for ( j= 1 ; j <= i; j++) { for ( k = 1 ; k <= j ; k++) cout<<"a"; } } Here , complexity = O(n³) 2. for ( i = 1 ; i <= n ; i=i*2) { for ( j = 1 ; j <= i ; j++) cout<< ... = O(n) . But I am getting O(2^n) (A gp was formed , first term = 1 = 2^0 , last term was 2^n so sum is 2^(n+1) which gives complexity as 2^n)
Ferox
asked
in
Algorithms
Sep 8
by
Ferox
116
views
algorithms
time-complexity
0
votes
0
answers
14
T(n) = 2^nT(n/2) + n^n find TC
T(n) = 2^nT(n/2) + n^n find TC
mohdraza
asked
in
Algorithms
Sep 1
by
mohdraza
107
views
algorithms
time-complexity
1
vote
2
answers
15
Doubt
What is Dijkstra's algorithm running time using sorted array?
preeti0448
answered
in
Algorithms
Aug 31
by
preeti0448
216
views
dijkstras-algorithm
20
votes
7
answers
16
GATE CSE 1996 | Question: 17
Let $G$ be the directed, weighted graph shown in below figure We are interested in the shortest paths from $A$. Output the sequence of vertices identified by the Dijkstra's algorithm for single source shortest path when the algorithm is started at node $A$ Write down ... vertices in the shortest path from $A$ to $E$ What is the cost of the shortest path from $A$ to $E$?
preeti0448
answered
in
Algorithms
Aug 30
by
preeti0448
5.4k
views
gate1996
algorithms
graph-algorithms
normal
descriptive
0
votes
0
answers
17
Asymptotic Functions
Consider f(n) and g(n) be asymptotic non-negative functions. So here can we say that min(f(n), g(n)) = Θ(f(n) + g(n)) My proof for this For f(n) = Θ(g(n)) c1*g(n) $\leq $ f(n) $\leq $ c2*g(n) such that c1, c2 >0 Considering the above definition ... ) So thus we can say that min(f(n), g(n)) = Θ(f(n) + g(n)) Is this the correct way? What would be the correct answer?
Chaitanya Kale
asked
in
Algorithms
Aug 29
by
Chaitanya Kale
107
views
algorithms
asymptotic-notations
1
vote
1
answer
18
Divide and conquer
How To Solve This Using Divide And Conquer Suppose we are given the two n bit integers, assuming for common sense n as power of 2. It is required to multiply them using Divide & conquer method. What is the divide & conquer recurrence, that would arise for the problem. 1. T(n) = 4T(n/2) + O(1) 2. T(n) = 2T(n/2) + O(n) 3. T(n) = 4T(n/2) + O(n^2) 4. T(n) = 4T(n/2) + O(n)
afroze
answered
in
Algorithms
Aug 28
by
afroze
103
views
algorithms
divide-and-conquer
recurrence-relation
0
votes
2
answers
19
UGC NET CSE | November 2017 | Part 2 | Question: 5
Consider the graph given below: Use Kruskal’s algorithm to find a minimal spanning tree for the graph. The List of the edges of the tree in the order in which they are chosen is AD, AE, AG, GC, GB, BF GC, GB, BF, GA, AD, AE GC, AD, GB, GA, BF, AE AD, AG, GC, AE, GB, BF
Arjun
answered
in
Algorithms
Aug 28
by
Arjun
1.3k
views
ugcnetcse-nov2017-paper2
graph-algorithms
minimum-spanning-tree
2
votes
0
answers
20
I-Gate Question
Consider the following algorithm, Dosomething( x, n) { m= n, temp= 1,z= x; while(m>0) do { while((m mod z)=0) do { m= Floor(m/2); z=z^2; } m = m-1, temp= temp* z; } return temp; } The complexity of above algorithm is Theta(log n) Theta(n log n) Theta(n^2) Theta(n)
loki2023
asked
in
Algorithms
Aug 23
by
loki2023
114
views
algorithms
time-complexity
i-gate-test-series
0
votes
1
answer
21
Dynamic Programming
int max(int a, int b) { return (a > b) ? a : b; } // Returns the maximum value that can be // put in a knapsack of capacity W int knapSack(int W, int wt[], int val[], int n) { // Base Case if (n == 0 || W == 0) return 0; // If ... , wt, val, n - 1), knapSack(W, wt, val, n - 1)); } This statement implies that the max value return by the two different recursive problems right?
ryandany07
asked
in
Algorithms
Aug 18
by
ryandany07
104
views
algorithms
dynamic-programming
knapsack-problem
0
votes
1
answer
22
Madeeasy Test Series
A hash table of size 10 using open addressing with linear probing and hash function is h(k)= (k)mod10 , where k is key value , initially table is empty . Following keys are inserted into table in given order . 44,87,43,68,30,20,67 How many number of probes required to insert 17 in table after inserting above keys?
Manisha Jaishwal
asked
in
Algorithms
Jul 25
by
Manisha Jaishwal
233
views
algorithms
made-easy-test-series
hashing
linear-probing
1
vote
1
answer
23
#doubt
BigO notation of T(n)=T(n-1)+ √n ; n>=1 =0. ; Otherwise
Subbu.
asked
in
Algorithms
Jul 18
by
Subbu.
177
views
algorithms
asymptotic-notations
time-complexity
0
votes
1
answer
24
#Dfs And Bfs
Please list the problems where BFS alone can do and DFS alone can do and both can do??
Subbu.
asked
in
Algorithms
Jul 16
by
Subbu.
82
views
algorithms
breadth-first-search
depth-first-search
0
votes
0
answers
25
Iteration Functions (Cormen)
Iterative functions: f(n)= n/logn c=2 What is f*(n) ? How to solve this question?
mb14
asked
in
Algorithms
Jul 6
by
mb14
108
views
algorithms
asymptotic-notations
0
votes
0
answers
26
what is the running time of the following iterative algorithm? b) It is possible to talk about the best, average and worst running times for this algorithm. Why?
usdid
asked
in
Algorithms
Jul 2
by
usdid
91
views
algorithms
time-complexity
0
votes
0
answers
27
please tell me whether the Branch & Bound concept and NP Hard & NP Complete concepts are there for gate or not in algorithms?
Vijay_Ram
asked
in
Algorithms
Jul 2
by
Vijay_Ram
50
views
algorithms
0
votes
1
answer
28
Shortest path in DAG and Travelling salesman problem are in DSA gate syllabus??
Vink7389
asked
in
Algorithms
Jun 27
by
Vink7389
71
views
syllabus
1
vote
1
answer
29
Recurrence Tree Method
T(n) = 5T(n/3) + T(2n/3) + 1. My answer is BigOmega(n) BigO(n). Am I right? This is a question I found on cs.stackexchange.
yuyutsu
asked
in
Algorithms
Jun 23
by
yuyutsu
245
views
recurrence-relation
algorithms
0
votes
1
answer
30
Solve equation using master theorem T(n) = 8T(n/2) + 3n^2
I can't figure out how to proceed and which case it's falling under after calculating h(n)
ItzDc
asked
in
Algorithms
Jun 3
by
ItzDc
330
views
algorithms
recurrence-relation
master-theorem
asymptotic-notations
0
votes
1
answer
31
BEGINNER FRIENDLY BOOK FOR ALGORITHMS ?
I wanted to read ALgorithms by cormen but is it to complex to read for beginners ? or i read from other book ? please tell about the cormen is it easy to read for gate and PSU interviews ?
ykrishnay
asked
in
Algorithms
May 22
by
ykrishnay
104
views
preparation
algorithms
algorithm-design
0
votes
1
answer
32
CMI 2021 B2
2. Imagine you are playing a computer game that consists of different types of coins. You have the power to cast two magic spells s1 and s2. Each spell consumes some number of coins of each type and produces some number of coins of each type. Spell s1 ... proper way and by the official method, I was not ale to come to proper answer I have also provide the official solution below.
ChayAdhiraj
asked
in
Algorithms
May 20
by
ChayAdhiraj
83
views
general-aptitude
algorithms
doubt
2
votes
0
answers
33
Why does Kruskal's algorithm find the minimum spanning tree if it's greedy? Isn't a minimum spanning tree a global optimization problem? Isn't the point of being greedy is that there is a chance you won't find the most optimal solution? So how can Kruskal be able to find the minimum spanning tree while also being greedy?
sandip_1999
asked
in
Algorithms
May 11
by
sandip_1999
120
views
kruskals-algorithm
prims-algorithm
minimum-spanning-tree
0
votes
0
answers
34
a) what is the iterative equation showing the running time of the algorithm whose pseudocode is given below? b) What is this repeated equation in asymptotic notation using the Master's theorem. c) What is the same repeated equation in asymptotic notation using the recursion tree method.
usdid
asked
in
Algorithms
Apr 16
by
usdid
125
views
asymptotic-notations
time-complexity
algorithms
0
votes
0
answers
35
what is the running time of the following iterative algorithm?
1 question: a) Calculate the running time of the following iterative algorithm. For this purpose, write the working time of each row in the corresponding column of the table in terms of ci coefficients. Write the number of reruns of each row in the ... of repetitions for i=1 to n do j=1; While (j<n) do j=j*2; Total: T(n)=
usdid
asked
in
Algorithms
Apr 16
by
usdid
86
views
algorithms
time-complexity
0
votes
1
answer
36
asymptotic notation
How to approach for this question?
Beyonder
asked
in
Algorithms
Apr 14
by
Beyonder
120
views
asymptotic-notations
2
votes
1
answer
37
NIELIT 2022 April Scientist B | Section B | Question: 44
What is the time complexity of the following function? void myfun() { int a,b; for(a=1; a<=n; a++) for(b=1; b<=log(a); b++) printf(“My Function”); } $\theta (n)$ $\theta (n^2)$ $\theta (n\log n)$ $\theta (n^2(\log n))$
soujanyareddy13
asked
in
Algorithms
Apr 12
by
soujanyareddy13
152
views
nielit2022apr-scientistb
algorithms
time-complexity
0
votes
2
answers
38
Test Series
What is the time complexity of the below mentioned recursive function. int f(n) { if(n!=1) { return f(n/2)+f(n/2); } else return 10; } O(n) O(n^2) O(log n) O(n logn)
Nitesh_Yadav
asked
in
Algorithms
Apr 11
by
Nitesh_Yadav
85
views
algorithms
time-complexity
recursion
test-series
0
votes
0
answers
39
Weighted vertices
Consider the minimum weight on a directed graph where, instead of edges vertices have weights. The weight of the path is sum of the weight of vertices excluding end points. The input is a graph with n vertices and m edges, Weigths Wv for ... this problem can be solved using Dijkstra's algorithms by converting weighted vertices to weighted edges? What will be the time complexity?
Vineeth Rambhiya
asked
in
Algorithms
Apr 9
by
Vineeth Rambhiya
67
views
Help get things started by
asking a question
.
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
Aptitude Overflow Book
Participate in Machine Learning benchmarking
GATE Overflow Tikz Templates
UPSC One Time Registration OTR Online Form 2022
DRDO CEPTAM 10 Online Form 2022
Subjects
All categories
General Aptitude
(2.4k)
Engineering Mathematics
(8.9k)
Digital Logic
(3.2k)
Programming and DS
(5.7k)
Algorithms
(4.5k)
Theory of Computation
(6.5k)
Compiler Design
(2.2k)
Operating System
(4.8k)
Databases
(4.4k)
CO and Architecture
(3.6k)
Computer Networks
(4.4k)
Non GATE
(1.2k)
Others
(2.5k)
Admissions
(644)
Exam Queries
(838)
Tier 1 Placement Questions
(17)
Job Queries
(72)
Projects
(9)
Unknown Category
(851)
Recent questions and answers in Algorithms
Recent Blog Comments
@GateOverflow04 link fixed now.
Try...
@Arjun @Deepak Sir, In Test Schedule google...
sir is this for gate? it has way more questions...
https://gateoverflow.in/tag/gate2010 this link is...