238 views

1 Answer

Related questions

329
views
1 answers
0 votes
Mrityudoot asked Mar 7
329 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$)?
616
views
1 answers
1 votes
Sajal Mallick asked Nov 28, 2023
616 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)?
219
views
0 answers
0 votes
237
views
0 answers
0 votes
Sajal Mallick asked Nov 27, 2023
237 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.