w****x 发帖数: 2483 | 1
那个因该不是最优解,但是想法蛮独特的,是csdn上一个人告诉我的,后来我实现了一
下,很久以前做的。
===============================================================
// Find the kth element in young table
// young table is a two dimensional matrix with its rows and columns sorted
// Solution
// It's hard to find the kth element directly, but its easy to find how many
elements are smaller than a given number.
// So, use binary search to find a number which is bigger than k elements in
the young table. Then, travel through
// the table to the ele... 阅读全帖 |
|