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
Webpage for Algorithms
Recent questions tagged algorithms
0
votes
2
answers
61
made easy gate cs question bank
What will be the output printed for find(4)? void find(int x) { static int i = 10, y = 0; y = y + i; for(i; i>0; i = i - 10) { if(x! = 0) find(x – 1); else printf(“%d”, y); } }
rohitkaushal1
asked
in
Programming
Sep 22
by
rohitkaushal1
184
views
algorithms
programming-in-c
loop
2
votes
1
answer
62
PhD Admissions Written Test (Basic)
Let A be an array containing n integers. It is required to find 3 indices i, j, k such that i < j < k and either A[i] ≤ A[j] ≤ A[k] or A[i] ≥ A[j] ≥ A[k], if such indices exist. The asymptotic time complexity of the fastest algorithm for this problem, assuming the array is already available, is Θ(_____________).
rsansiya111
asked
in
Others
Sep 11
by
rsansiya111
73
views
data-structures
algorithms
0
votes
0
answers
63
Data structures and algorithms
Assume Two-Dimensional Sorted Array (TDSA) is a two-dimensional matrix of size n × n such as the elements in the matrix are sorted row-wise and column-wise. For example, the following matrix is a TDSA. 1 2 3 4 5 6 7 8 9 Write an algorithm that should convert the given matrix of a dimension n × n into TDSA. Analyse the running time of the algorithm.
Karthi2003
asked
in
DS
Sep 9
by
Karthi2003
153
views
algorithms
sorting
time-complexity
0
votes
0
answers
64
Data structures and algorithms
Compute the running time for the following algorithm ALGORITHM RKU(a,k,n) //Input: a is an array of n element and k is a value { if( k == n) then { WRITE(a[1:n]); return 0; } else { for i ← k to n do { t ← a[k]; a[k] ← a[i]; a[i] ← t; RKU(a, k+1, n); t ← a[k]; a[k] ← a[i]; a[i] ← t; } }
Karthi2003
asked
in
DS
Sep 9
by
Karthi2003
141
views
algorithms
time-complexity
0
votes
1
answer
65
Algorithms
Given ‘N’ objects, which are coloured as red, white and blue. Sort these objects so that objects of the same colour are adjacent, with the colours in the order red, white and blue. Design an algorithm with a time com- plexity of O(nlog n)
Karthi2003
asked
in
DS
Sep 9
by
Karthi2003
229
views
algorithms
sorting
time-complexity
0
votes
0
answers
66
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
171
views
algorithms
time-complexity
1
vote
1
answer
67
TIFR CSE 2022 | Part B | Question: 3
Consider the problem of sorting $n$ single digit integers (base $10$). This problem can be solved in time $O(n \log n)$ but not $O(n \log \log n)$ $O(n \log \log n)$ but not $O(n)$ $O(n)$ but not $O(n / \log \log n)$ $O(n / \log \log n)$ None of the above.
admin
asked
in
Algorithms
Sep 1
by
admin
111
views
tifr2022
algorithms
sorting
time-complexity
1
vote
0
answers
68
TIFR CSE 2022 | Part B | Question: 4
Consider the following algorithm for computing the factorial of a positive integer $n$, specified in binary: prod ← 1 for i from 1 to n prod ← prod i output prod Assume that the number of bit operations required to multiply a $k$-bit positive integer with an $\ell$ ... $\omega(n \log n)$ $O\left(n^3\right)$ but $\omega\left(n^2\right) $ None of the above
admin
asked
in
Algorithms
Sep 1
by
admin
163
views
tifr2022
algorithms
identify-function
time-complexity
1
vote
0
answers
69
TIFR CSE 2022 | Part B | Question: 10
Consider the assertions $\text{(A1)}$ Given a directed graph $G$ with positive weights on the edges, two special vertices $s$ and $t$, and an integer $k$ - it is $\text{NP}$-complete to determine if $G$ has an $s- t$ path of length at most $k$ ... $\text{A1}$ does not imply $\text{A2}$ and $\text{A2}$ does not imply $\text{A1}$ None of the above.
admin
asked
in
Algorithms
Sep 1
by
admin
36
views
tifr2022
algorithms
graph-connectivity
p-np-npc-nph
2
votes
0
answers
70
TIFR CSE 2022 | Part B | Question: 11
Consider the following function $\textsf{count},$ that takes as input $a,$ an array of integers, and $\textsf{N}$, the size of the array. int count(int a[], int N) { int i, j, count_FN; count_FN = 0; for (i=1 ; i<N ; i++) { j=i-1 ; while ... $\textsf{N} \geq c$, for all arrays of size $\textsf{N, count_FN} \geq \textsf{N}^2 / c$ None of the above
admin
asked
in
Algorithms
Sep 1
by
admin
103
views
tifr2022
algorithms
sorting
1
vote
0
answers
71
TIFR CSE 2022 | Part B | Question: 13
Consider a directed graph $G=(V, E)$, where each edge $e \in E$ has a positive edge weight $c_e$. Determine the appropriate choices for the blanks below so that the value of the following linear program is the length of the shortest directed path in $G$ from $s$ ... $\text{blank }1: \min, \text{blank }2:\; \geq$ $\text{blank }1: \min, \text{blank }2:\; =$
admin
asked
in
Algorithms
Sep 1
by
admin
56
views
tifr2022
algorithms
shortest-path
0
votes
0
answers
72
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
136
views
algorithms
time-complexity
2
votes
1
answer
73
Algorithm which uses Max heap to find i smallest elements
Can anyone please explain how to find “ i “ smallest elements from an array whose elements are distinct Please use max heap to explain the working input : n distinct elements output : i smallest elements
Thor-o-s
asked
in
DS
Sep 1
by
Thor-o-s
121
views
algorithms
binary-heap
data-structures
0
votes
0
answers
74
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
132
views
algorithms
asymptotic-notations
1
vote
1
answer
75
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)
[ Jiren ]
asked
in
Algorithms
Aug 28
by
[ Jiren ]
136
views
algorithms
divide-and-conquer
recurrence-relation
2
votes
0
answers
76
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
140
views
algorithms
time-complexity
i-gate-test-series
0
votes
1
answer
77
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
185
views
algorithms
dynamic-programming
knapsack-problem
Page:
« prev
1
2
3
4
5
6
7
8
...
107
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
POWER GRID CORPORATION OF INDIA LIMITED
INSTITUTE OF BANKING PERSONNEL SELECTION
GATE Overflow books for TIFR, ISRO, UGCNET and NIELIT
RECRUITMENT IN OIL AND GAS CORPORATION LIMITED
Aptitude Overflow Book
Subjects
All categories
General Aptitude
(2.4k)
Engineering Mathematics
(9.1k)
Digital Logic
(3.2k)
Programming and DS
(5.8k)
Algorithms
(4.5k)
Theory of Computation
(6.6k)
Compiler Design
(2.3k)
Operating System
(4.9k)
Databases
(4.5k)
CO and Architecture
(3.7k)
Computer Networks
(4.5k)
Non GATE
(1.3k)
Others
(2.4k)
Admissions
(647)
Exam Queries
(841)
Tier 1 Placement Questions
(17)
Job Queries
(74)
Projects
(9)
Unknown Category
(855)
Recent questions tagged algorithms
Recent Blog Comments
@abir_banerjee Thanks Abir. I'm third year...
@nolan_keats Currently I am in third year...
@abir_banerjee thank you Abir.Supposing you...
@nolan_keats just a suggestion as I also...
@abir_banerjee Hope I can do this in span of one...