Question DSA-GRDY-0019
MediumWhat is the time complexity of the greedy activity-selection algorithm for n activities?
- A.
O(n log n), dominated by sorting by finish time
- B.
O(2ⁿ)
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Greedy question
What is the time complexity of the greedy activity-selection algorithm for n activities?
O(n log n), dominated by sorting by finish time
O(2ⁿ)
Sign up free to see the answer and a step-by-step explanation.
O(n²)
O(log n)