retagged by
475 views
1 votes
1 votes

https://gateoverflow.in/?qa=blob&qa_blobid=16020532755515515346

Shouldnt the answer be option d? How option c?

retagged by

1 Answer

1 votes
1 votes

Option D is correct as 

Best case occurs when m%n==0 or n%m==0 which takes omega(1) time

worst case occurs when two numbers are prime or co-prime which takes logn time ie O(log2 (min (m,n))) 

edited by

Related questions

2 votes
2 votes
1 answer
1
Hirak asked May 21, 2019
1,244 views
.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 do...
0 votes
0 votes
1 answer
2
Hirak asked Apr 7, 2019
951 views
Find the total number of comparisons if merge sort is used. Explain with proper steps.2, 5, 8, 4, 1, 7, 6, 3Total no of comparison.
1 votes
1 votes
0 answers
3
Human asked Oct 8, 2018
467 views
They have give option c as the answer. But for me both option b and d seems correct? Can someone please clarify.
1 votes
1 votes
1 answer
4
Human asked Oct 8, 2018
622 views
how the answer is 23699?For column major order I get answer as 80039.Even if i go by row major order the answer I get is 23599