Recent questions tagged algorithms

0 votes
2 answers
1203
0 votes
1 answer
1204
In Quicksort let n/7​ th ​ smallest element is chosen using an O(n2​ ) algorithm as thepivot. Calculate the worst case time complexity of the algorithm.
0 votes
1 answer
1205
Minimum no of comparisons required to find the minimum and maximum of n distinct elements
0 votes
1 answer
1206
What is the time complexity of Prim algorithm without using min heap?
0 votes
3 answers
1207
What is the total number of comparisons needed in the best case to find minimum and maximum of $300 $ elements?
1 votes
0 answers
1208
Given an array where numbers are in range from 1 to n6, which sorting algorithm can be used to sort these number in linear time?1)Counting Sort2)Radix Sort3)Bubble Sort4)...
3 votes
1 answer
1209
How many swaps are performed in Merge sort algorithm in worst case?
3 votes
1 answer
1210
0 votes
3 answers
1211
5 votes
3 answers
1214
2 votes
0 answers
1215
Consider the multistage graph with 6 stages then what is the minimum cost from Source node (A) to Destination node (N) using Greedy Method ______
0 votes
1 answer
1221
0 votes
0 answers
1222
"FIFO sometimes can support stack property" And sometimes not and so,it will fall in bealady's anomalyWhy is it so ?
0 votes
1 answer
1223
If both of the algorithms A and B need O(nlogn) time then theyboth are equally efficient and finish in same amount of time.TRUE OR FALSE
0 votes
1 answer
1224
Find the complexity of the following code fragment:int i = 1; for(; i <= n logn; i++) { for(i++; i <= n; i++) { printf("1") } }
1 votes
2 answers
1226
Find the complexity of the following function when called with some integer n:void foo(n) { int i,j,k,x=0; for (i=1 ; i <= n ; i++) for (j=1 ; j <= i * i ; j++) for ( k ...
0 votes
2 answers
1227
FIND THE TIME COMPLEXITYint i=1,j; for(;i <= n;i + +) { for(j = i; j <= nlogn; j∗= 2) { sum++; } }
0 votes
0 answers
1229
State true/falsef(n) != O(g(n)) and g(n) != O(f(n))
0 votes
2 answers
1230