694 views
0 votes
0 votes
As we know the time complexity of solving the greedy knapsack algorithm depends mainly on the sorting algorithm used, Can we use counting sort as the sorting algorithm to reduce the time complexity to O(n)?

1 Answer

Related questions

1 votes
1 votes
1 answer
1
sumitr asked Apr 10, 2019
1,300 views
What is the best case and worst case of the algorithm? And when will best case and worst case will happen??int main() { for(i=1 ; i<=n ; i++) { if(n%i == 0) { for(j=1 ; j...
0 votes
0 votes
1 answer
2
eyeamgj asked Aug 25, 2018
487 views
suppose we are given a sorted array ....and we need to extract minimum every tym what is the time complexity??and what is the tym complexity to delete the minimum ? are ...
0 votes
0 votes
1 answer
4
LavTheRawkstar asked Jan 12, 2017
833 views
INSERTION-SORT (A, n) ⊳ A[1 . . n]for (j ← 2 to len(A) ){key ← A[ j];i ← j – 1 ; while (i 0 and A[i] key) { A[...