Awesome q2a theme
Ask us anything
Toggle navigation
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Exams
Recent questions tagged timecomplexity
0
votes
0
answers
InterviewBit
In the following C function, let $n >= m$. int gcd(int n, int m) { if (n%m ==0) return m; if (n < m) swap(n, m); while (m > 0) { n = n%m; swap(n, m); } return n; } What is the time complexity of the above function assuming n > m?
asked
2 days
ago
in
Algorithms
by
Sambhrant Maurya
(
401
points)

7
views
timecomplexity
0
votes
1
answer
Find time complexity of this python function
Find Time Complexity of the following function?? def function3(n): if n <= 0: return for i in range(0, 3): function3(0.8 * n)
asked
Mar 24
in
Algorithms
by
BHASHKAR
(
6
points)

10
views
algorithms
timecomplexity
0
votes
0
answers
time complexity self doubt
FIND THE TIME COMPLEXITY OF THE FOLLOWING CODE. int p=2^n for(i=1;p>=n;i++) { p=p/i; }
asked
Mar 11
in
Algorithms
by
NIKHIL GOBHIL
(
6
points)

13
views
timecomplexity
algorithms
iterativecomplexity
0
votes
0
answers
#Algorithm #Time complexity #Fibonacci series
What is the time complexity of computing Fibonacci series using recursive algorithm? Though there are several questions and answers related to this and in most of the answer says its O(2^n), but in stackexchange some answers are O(1.623^n).. Someone please clarify what should be the answer..
asked
Feb 20
in
Algorithms
by
souren
(
28
points)

27
views
timecomplexity
algorithms
0
votes
0
answers
Self doubt finding complexity algorithms where study this topic
asked
Feb 9
in
Algorithms
by
Ram Swaroop
(
270
points)

39
views
timecomplexity
algorithms
#algorithms
0
votes
0
answers
Time Complexity Analysis  worst case
A() { int n = ((2)^2)^k; for(int i =1; i <= 2; i++) { j=2; while(j <= n){ j = j^2; printf(“pankaj”); } } } How many times pankaj will be printed and it’s time complexity?
asked
Feb 4
in
Algorithms
by
pppankajsaini
(
8
points)

57
views
algorithms
timecomplexity
0
votes
1
answer
Algorithms, complexity
Assume we have n number of unsorted list is given. Each list containing m integers such that n>m. What will be the time to sort in a single list ? Ans given: O(m x nlogn)
asked
Feb 2
in
Algorithms
by
dhairya16
(
6
points)

36
views
algorithms
timecomplexity
madeeasytestseries
0
votes
0
answers
Made Easy test series algorithm complexity occurance of element more than 2n/3 times
asked
Jan 26
in
Algorithms
by
Ram Swaroop
(
270
points)

29
views
madeeasytestseries
timecomplexity
algorithms
#array
0
votes
0
answers
Made Easy test series algorithm complexity
Given an array S containing n real numbers, and a real number We want to find any two elements p and q in the array such that their sum is greater than the real number What is the best possible time complexity to find p and q ? O(1) O(n) O(n log n) O(n^2logn)
asked
Jan 24
in
Algorithms
by
Ram Swaroop
(
270
points)

20
views
madeeasytestseries
timecomplexity
algorithms
0
votes
1
answer
Algorithms timecomplexity
asked
Jan 22
in
Algorithms
by
Chirag Shilwant
(
180
points)

37
views
timecomplexity
aceacademytestseries
algorithms
0
votes
0
answers
Madeeasy test series  recurrence relation
asked
Jan 21
in
DS
by
luc_Bloodstone
(
36
points)

7
views
recurrencerelations
madeeasytestseries
timecomplexity
algorithms
0
votes
1
answer
Made Easy Mock 2
int s=0; for(int b=1;b<=n;b*=2) { for(int i=0;i<b;i++) { for(int j=0;j<n;j+=2) { s=s+j; } for(int j=1;j<n;j*=2) { s=s+j; } } } What is the TC of above code? Please illustrate the sigma summation method.
asked
Jan 16
in
Algorithms
by
Sambhrant Maurya
(
401
points)

50
views
timecomplexity
algorithms
0
votes
0
answers
Ace Academy test Series : Time Complexity
asked
Jan 14
in
Algorithms
by
Chirag Shilwant
(
180
points)

19
views
aceacademytestseries
timecomplexity
algorithms
0
votes
0
answers
Madeeasy test series  Increase order of function
I tried this by taking some bigger values of n and then comparing the results but getting the different answer then the one they have given. Please help.
asked
Jan 8
in
Algorithms
by
luc_Bloodstone
(
36
points)

22
views
madeeasytestseries
algorithms
timecomplexity
0
votes
0
answers
Made easy test series : Time complexity
asked
Jan 6
in
Programming
by
Chirag Shilwant
(
180
points)

68
views
timecomplexity
cprogrammingforgate
madeeasytestseries
0
votes
1
answer
Self Doubt:Algorithm Time complexity
$If$ $t1(n) = Ο(f(n)),$ $t2(n)= Ο(g(n)).$ $Then$ $t1(n).t2(n)= O(f(n)*g(n))$ $Is$ $the$ $above$ $statement$ $always$ $TRUE?$
asked
Jan 3
in
Programming
by
Debapaul
(
699
points)

24
views
timecomplexity
0
votes
0
answers
Time Complexity Of Algorithm, GATE 1999
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 ... ? We usually don't count the number of function calls that are being made in a recursive function.
asked
Jan 2
in
Algorithms
by
goxul
(
377
points)

21
views
timecomplexity
algorithms
0
votes
1
answer
Time complexity Ace test series
asked
Dec 29, 2019
in
Algorithms
by
Chirag Shilwant
(
180
points)

42
views
timecomplexity
algorithms
aceacademytestseries
question
0
votes
1
answer
ProgrammingLanguageC
#include <stdio.h> int main(void) { void fun(); fun(); fun(); } void fun(){ static int i = 1; auto int j = 5 ; printf("%d",i++); printf("%d",j++); } What will be the output of the code
asked
Dec 25, 2019
in
Programming
by
grv_99
(
9
points)

44
views
cprogrammingforgate
madeeasytestseries
algorithms
timecomplexity
programming
0
votes
0
answers
Applied course test series : Time complexity of Recurrence relation
asked
Dec 18, 2019
in
Algorithms
by
vishal burnwal
(
135
points)

36
views
timecomplexity
0
votes
0
answers
Made easy test series Algorithms asymptotic
asked
Dec 17, 2019
in
Algorithms
by
Chirag Shilwant
(
180
points)

15
views
algorithms
asymptoticanalysis
madeeasytestseries
timecomplexity
0
votes
1
answer
MULTIPLE SUBJECT : ALGORITHMS + PROGRAMMING AND DATA STRUCTURES (GATE  2020)  QUESTION 27
asked
Dec 12, 2019
in
Algorithms
by
Pratyush Priyam Kuan
(
804
points)

20
views
algorithms
madeeasytestseries
timecomplexity
0
votes
0
answers
Made Easy Test: Algorithms
What is the TC of the following? int i,j,k,m=0; for(i=1;i<n;i++){ for(j=1;j<i*i;j++){ if (j%i==0) for(k=1;k<j;k++) m=m+1; } }
asked
Dec 10, 2019
in
Algorithms
by
Sambhrant Maurya
(
401
points)

16
views
madeeasytestseries
algorithms
timecomplexity
0
votes
1
answer
self doubt on time complexity
What is the recurrence equation and how to solve it?
asked
Dec 6, 2019
in
Algorithms
by
Abhipsa
(
17
points)

14
views
algorithms
timecomplexity
0
votes
0
answers
self doubt in algorithms time complexity
What is the answer for this?
asked
Dec 6, 2019
in
Algorithms
by
Abhipsa
(
17
points)

7
views
algorithms
timecomplexity
#algorithms
0
votes
1
answer
Solve the recurrence relation: T(n) = T(n^(1/2)) + n
asked
Dec 4, 2019
in
Algorithms
by
avistein
(
355
points)

10
views
recurrencerelations
timecomplexity
0
votes
0
answers
Self doubt on time complexity calculation
Please show how to calculate time complexity of $T(n) = 3T(n/4) + n^2$ using recursion tree method. Thanks!
asked
Nov 29, 2019
in
Algorithms
by
Abhipsa
(
17
points)

16
views
algorithms
timecomplexity
0
votes
0
answers
Self doubt on time complexity calculation
What is the time complexity of the following recurrence equation : T(n) = T(n/2) + T(n/4) + T(n/8) + n I solved it using recursion tree method and I'm getting O(n) as the answer. Please let me know the answer and the procedure you used. Thank you.
asked
Nov 29, 2019
in
Algorithms
by
Abhipsa
(
17
points)

16
views
algorithms
timecomplexity
0
votes
1
answer
Madeeasy Test series  time complexity
What is the time complexity of foo() and bar() ? I solved it and get ans correct for foo(), but for bar() I am getting wrong ans, for bar(): T(n) = 2T(n1) + c; c is constant I solved it and get this: T(n) = 2^(n1) * 3^n ... bar() is T(n) = O(2^n), I don't understand how they get this. Is my recurrence equation is wrong or something else, please solve this.
asked
Nov 29, 2019
in
Algorithms
by
luc_Bloodstone
(
36
points)

29
views
timecomplexity
madeeasytestseries
algorithms
data_structure
0
votes
1
answer
MadeEasy Test Series  Calculate time complexity
What is the time complexity of below function? Can we able to solve it by Masters Theorem?
asked
Nov 25, 2019
in
Algorithms
by
luc_Bloodstone
(
36
points)

32
views
timecomplexity
madeeasytestseries
algorithms
data_structure
0
votes
0
answers
Ace Test Offline
i=n; while(i>0) { k=1; for(j=0;j<=n;j+=k) k++; i/=2; } The time complexity of following piece of code is: $O(nlog(n))$ $O(log^2n)$ $O(n^2)$ $O(log(n*sqrt(n)) $
asked
Nov 17, 2019
in
Algorithms
by
Akash Papnai
(
17
points)

28
views
timecomplexity
algorithms
0
votes
0
answers
Applied Gate Test series
Find the time complexity of codes below – for(i=1;i<n*n*n*;i*=n) { for(j=0;j<n;j+=2) { for(k=1;k<n;k*=3) { //constant; } } } for(i=0;i<n;i++) { if(i mod 2 ==0) { for(j=i;j<n;j++) { if(i%2==0 && j%2==0) printf("Gate 2020"); } } }
asked
Nov 3, 2019
in
Algorithms
by
MRINMOY_HALDER
(
37
points)

44
views
algorithms
timecomplexity
0
votes
0
answers
TIme complexity Made easy
What is time complexity for this function?
asked
Oct 17, 2019
in
Algorithms
by
vupadhayayx86
(
6
points)

26
views
timecomplexity
programming
madeeasytestseries
gate
0
votes
0
answers
geekforgeeks
int a = 0; for (i = 0; i < N; i++) { for (j = N; j > i; j) { a = a + i + j; } } my doubt is an inner loop (J) is depend on i variable which is run n times. now how to evaluate the inner loop. please explain in details how TC is calculated.
asked
Oct 10, 2019
in
Algorithms
by
Hira Thakur
(
8
points)

10
views
timecomplexity
algorithms
0
votes
1
answer
MadeEasy Workbook, DRDO 2008
Consider a sequence A of length n which is sorted except for one item that appears out of order.Which of the following can sort the sequence in O(n) time? (a) Heap sort (b) Quick sort (c) Merge sort (d) Insertion sort
asked
Oct 9, 2019
in
Algorithms
by
Ansaaa24
(
9
points)

51
views
madeeasyworkbook
timecomplexity
algorithms
divideandconquer
0
votes
2
answers
made easy test series quick sort time complexity
asked
Sep 20, 2019
in
Algorithms
by
ck
(
13
points)

38
views
timecomplexity
quicksort
0
votes
0
answers
Made easy Test Series question....
Consider th following cases for quick sort to sort an array of n element $a[0...n1]$ i) Choosing the pivot element randomly from the given array ii) choosing median element as pivot. Iii) Choosing middle element as pivot For which of the above cases quick sort always gives $O(nlogn)$ time complexity?
asked
Sep 11, 2019
in
Algorithms
by
`JEET
(
179
points)

16
views
algorithms
timecomplexity
testseries
#testseries
sorting
0
votes
2
answers
Made easy test series question.
For the below message number of bits required in Huffman Coding is: abbaabccdabcd
asked
Sep 11, 2019
in
Algorithms
by
`JEET
(
179
points)

32
views
algorithms
timecomplexity
testseries
#testseries
0
votes
1
answer
Made easy test series.
Let $g(n) = \Omega(n)$, $f(n) = O(n)$ and $h(n) = \theta(n)$ then what is the time complexity of $[g(n) f(n) + h(n)]$ How to solve such questions?
asked
Sep 11, 2019
in
Algorithms
by
`JEET
(
179
points)

21
views
algorithms
timecomplexity
0
votes
0
answers
Made Easy online test series
Consider an array A of length n, array contain number between (1 – 10), in any arbitary order, best sorting algorithm takes $650$ ns if $n = 50$, the time required by algorithm if n = 300.
asked
Sep 11, 2019
in
Algorithms
by
`JEET
(
179
points)

15
views
algorithms
sorting
timecomplexity
Page:
1
2
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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users
Apr 2020
!KARAN
36 Points
lazygatestudent
5 Points
AngeloAlba89
5 Points
WillKnisley
5 Points
TamieMcvay4
5 Points
Satyaki Das
5 Points
akansha03
5 Points
srestha
3 Points
Shivateja MST
2 Points
souren
2 Points
Monthly Top User and those within 60% of his/her points will get a share of monthly revenue of GO subject to a minimum payout of Rs. 500. Current monthly budget for Top Users is Rs. 75.
3,511
questions
1,656
answers
10,449
comments
90,037
users