240 views

1 Answer

Related questions

335
views
1 answers
0 votes
Mrityudoot asked Mar 7
335 views
For flag based approach in Bubble sort we can check first by a flag if the list is sorted or not in O(n), and if it is sorted, then no need to sort ... the same concept applicable to selection sort? Why it never comes down from O(n$^2$)?
623
views
1 answers
1 votes
Sajal Mallick asked Nov 28, 2023
623 views
Consider the problem that given a set Sof n integers and another integer x, whether or not there exist two elements in S whose sum is exactly x. What is the worst ... in dynamic programming? Then complexity should be O(n^2).How O(n logn)?
222
views
0 answers
0 votes
240
views
0 answers
0 votes
Sajal Mallick asked Nov 27, 2023
240 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). But ans is (b). Anyone please explain.