| Random Link ¯\_(ツ)_/¯ | ||
| Aug 1, 2022 | » | Sorting and Searching
5 min; updated Aug 1, 2022
Order StatisticsK-th Smallest Element in Sorted Matrix
It’s not guaranteed that Using a priority queue that holds the \(K\) smallest elements does not work because the memory usage is \(O(K)\), where \(K\) can be any value in \([1, N^2]\). Furthermore, that doesn’t take into account that the rows and columns are already sorted. ... |