🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.O(n) time, O(1) space
  2. B.O(n log n) time, O(1) space
  3. C.O(n²) time, O(1) space
  4. 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 →