Leetcode 973 - K Closest Points To Origin (JAVA Solution Explained!)
Вставка
- Опубліковано 19 вер 2024
- Leetcode 973 - K Closest Points To Origin (JAVA Solution Explained!)
If you like this video, please 'Like' or 'Subscribe'. This is really helpful for my channel and also motivates me to do more. Stay tuned!
In case you wonder, at the end of line 6, there is an extra semicolon. Please delete the semicolon and it will be passing.
What would be the space complexity ?
Quick question what would the space complexity ?
Just N. to be exact just original input plus k.
what is the time complexity, isn't Quick Select a better alternative for time complexity?
Quick select is good and it is O(n) Depend on the mid point selection.
PQ is N*LogK, k is the size of the heap