← Quiz: Kadane's Algorithm: all 13 questions
Quiz: Kadane's Algorithm · Question 4 of 13
What are the time and extra space of Kadane's algorithm?
What are the time and extra space of Kadane's algorithm?
- A.O(n) time, O(1) space
- B.O(n log n) time, O(1) space
- C.O(n²) time, O(1) space
- D.O(n) time, O(n) space
Answer & explanation
Correct answer: O(n) time, O(1) space
One pass with two variables.
Can you get the rest right without peeking?
Take the timed Quiz: Kadane's Algorithm quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →