由买买提看人间百态

topics

全部话题 - 话题: jcur
(共0页)
w****x
发帖数: 2483
1
来自主题: JobHunting版 - 发个一直没有见过满意答案的题吧

那个因该不是最优解,但是想法蛮独特的,是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... 阅读全帖
(共0页)