马英九到底有没有绿卡 大选吵翻天# Joke - 肚皮舞运动
H*e
1 楼
两个题目
1.
Given an array of integers, find out number of ways in which you can select
increasing subsequences of length k(k<=n).e.g.array is 1 4 6 2 5 & k=3 then
the answer is : 1 4 5, 1 2 5,1 4 6, 1 2 6,所以总数是4
2.
Given a sorted array of n integers, pick up k elements so that the minimal
difference between consecutive elements is maximized (that is choose the
elements to maximize the quantity min(a[i+1] - a[i]))
1.
Given an array of integers, find out number of ways in which you can select
increasing subsequences of length k(k<=n).e.g.array is 1 4 6 2 5 & k=3 then
the answer is : 1 4 5, 1 2 5,1 4 6, 1 2 6,所以总数是4
2.
Given a sorted array of n integers, pick up k elements so that the minimal
difference between consecutive elements is maximized (that is choose the
elements to maximize the quantity min(a[i+1] - a[i]))