Kth Largest Element in an Array - Leetcode

preview_player
Показать описание
😎 Links 😎

🎧 Music 🎧
Music by HoobeZa
Рекомендации по теме
Комментарии
Автор

I like this solution, but is this any better than just doing Collections.sort()? Each add() operation will be log(n) time, so total of n log (n). Which is the same as Collections.sort(). I'm asking because I did this in an interview and I don't know if my answer was considered good enough.

sarnobat
visit shbcf.ru