1

What would be an efficient method to find the kth smallest element in an array with worst case time complexity being $ O(n) $?

SiluPanda
  • 549
  • 1
  • 3
  • 12

1 Answers1

1

You can use quickselect with median of medians to find a good pivot so that the total running time is linear in the worst case.

Juho
  • 22,554
  • 7
  • 62
  • 115