Recent questions tagged algorithms

0 votes
1 answer
1802
complexity of kruskal algorithum for finding the minimum cost spanning tree of an undirected graph contain n vertices and m edges if the edge are already sorted.??
0 votes
0 answers
1805
https://gateoverflow.in/?qa=blob&qa_blobid=15895383759487537860find complexity ??where n is prime.someone plz explain??
0 votes
0 answers
1806
0 votes
1 answer
1808
2 votes
2 answers
1809
2^2n =O(2^n) True or FalseIts false but why
0 votes
0 answers
1811
I wanted to know how θ is derived for a problem. Can we write it directly Example n^4 + n^3+ n^2 Here worst case will be n^4 since it is the term with highest power(wors...
1 votes
0 answers
1812
Let P be a single linked list.Let Q be a pointer to an intermediate node 'X' in the list.What is the worst case time complexity of best known algorithm to delete the node...
1 votes
1 answer
1813
Base condition T(n) = 1Otherwise T(n) = T(n-1) +n Then After solving i got to this step ...how should i generalize nowT(n) = T( n-k) + n-(k-1) + n-(k-2)+n
3 votes
1 answer
1814
From CLRS the complexity of radix sort is theta(d(n+k)) where d is # of digits , k is range and n is numbers . So how option C is right . Plz solve it on the basis of min...
1 votes
2 answers
1815
Hello,I have doubt regarding prims algorithm1)should we choose the lowest cost edge and then implement algo further?2)Or we choose any vertex and then lowest cost edge of...
3 votes
0 answers
1816
1 votes
1 answer
1817
for ( i= 1; i<=n; i++) for(j=n/3: j<=2n; j=j+n/3) sum =sum+1;What will be O and θ for this
0 votes
0 answers
1819
The average number of inversions in an unsorted array of n elements is?(Two elements a[i] and a[j] form an inversion if a[i] a[j] and i < j)A.) n(n-1)/2B.) n(n-1)/4C.) n...
2 votes
1 answer
1821
0 votes
1 answer
1822
2 votes
1 answer
1823
for i < - 1 to n for j < 1 to n/2 X = X + 1(i and j both are incrementing by 1)Outer runs for n times and inner for n/2 So will it be n(n...
0 votes
0 answers
1824
T(n) = T(n-1) + nIn which case it falls ??
0 votes
1 answer
1825
T(n) = 4T(n/2) + C ......where C ConstantT(n) = 16T(n/4) + 5CCant figure out how to generalize and compare with base condition T(n) = 1 from above step.
1 votes
0 answers
1826
T(n) = 2T(n/2) + log nBy substitution T(n) = 4T(n/4) + 2log n/2 + lognI got stucked here
0 votes
0 answers
1827
2 votes
1 answer
1828
Hi Guys,What is the time complexity of Insert, Search and Delete operation in Multiway Trees (mainly B-tree and B+ Tree) ?
2 votes
3 answers
1829
Two unsorted arrays of size m and n are to be sorted into a single array, what is best case time complexity?