413 views
1 1 vote

1 Answer

2 2 votes
answer will be O(n^2)
see, for normal merge sort, we do T(n)=2T(n/2) + n, here n because comparing and mergin takes order of n time
now in this question, it will be T(N)=T(1) + T(n-1) + n
this will give us order of n^2
 
Position:
Show:

Related questions

0 0 votes
1 1 answer
526
526 views
Sajal Mallick asked Nov 27, 2023
526 views
As we have to select maximal set of “non overlapping” activities. So like job scheduling algo of greedy we can solve it. So according to that complexity must be O(n logn)...
5 5 votes
3 3 answers
18.0k
18.0k views
Lakshman Bhaiya asked Nov 10, 2018
17,984 views
If job $J=(J_{1},J_{2},J_{3},J_{4})$ are given their processing time $T_{i}=(1,1,2,3)$ and deadline are $D_{i}=(3,4,2,3)$ maximum how many job can be done$?$$A)1$ ...
0 0 votes
2 2 answers
2.0k
2.0k views
Vaishnavi01 asked Sep 25, 2018
2,019 views
Single source shortest path problems can be implemented by greedy algorithms usingA. Singly linked listB. Min heapC. AVL treeD. All of the above
1 1 vote
2 2 answers
2.1k
2.1k views
radha gogia asked Jul 22, 2018
2,117 views
what is the time-complexity in kruskal algorithm for the overall step 2 where for each vertex Make-set function is called ? How come overall time for this step is O(v lo...