b*********n 发帖数: 1258 | 1 Write a method that counts how many elements in an unsorted array are out of
order | p*****2 发帖数: 21240 | | K*********n 发帖数: 2852 | 3 另外,有无duplicate
【在 p*****2 的大作中提到】 : [2,1] 应该返回1, 还是2?
| d**********x 发帖数: 4083 | 4 题目描述太模糊
第一印象是那个merge sort的变形。。
of
【在 b*********n 的大作中提到】 : Write a method that counts how many elements in an unsorted array are out of : order
| f*****e 发帖数: 2992 | 5 应该问how many pairs are out of order。CLRS上就好像有。
of
【在 b*********n 的大作中提到】 : Write a method that counts how many elements in an unsorted array are out of : order
| l****o 发帖数: 315 | | f*********i 发帖数: 197 | 7 It is a longest increasing/decreasing sub-sequence question.
suppose the unsorted array length N, and have n sequence that are
monotonically increasing/decreasing. then N-n is the output.
It takes O(nlogn) in general |
|