c********e 发帖数: 383 | 1 1) code to find Cnl (possibilities of grabing L elements out of N)
2) how to find the median number using stl , given an integer array. |
t****t 发帖数: 6806 | 2 不会吧,这你不会做?
(1)是要列举每种结果还是算个数目就好了? (是C(n,l)吧?)
【在 c********e 的大作中提到】 : 1) code to find Cnl (possibilities of grabing L elements out of N) : 2) how to find the median number using stl , given an integer array.
|
l*********b 发帖数: 8 | 3
recursive. mark used element, advance the pointer and call itself
nth_element()
【在 c********e 的大作中提到】 : 1) code to find Cnl (possibilities of grabing L elements out of N) : 2) how to find the median number using stl , given an integer array.
|
c********e 发帖数: 383 | 4 no ah..just been asked,
for the first question sorta dynamic programming skill can be applied.
for the second one nth_element. but i am stuck with the run time cost.
the average linear time
【在 t****t 的大作中提到】 : 不会吧,这你不会做? : (1)是要列举每种结果还是算个数目就好了? (是C(n,l)吧?)
|
c*****t 发帖数: 1879 | 5
you must use that algorithm a lot ^_^
【在 l*********b 的大作中提到】 : : recursive. mark used element, advance the pointer and call itself : nth_element()
|
f*z 发帖数: 421 | 6 第一题题目没看懂,那位给说一下,到底要做什么啊?
【在 c********e 的大作中提到】 : 1) code to find Cnl (possibilities of grabing L elements out of N) : 2) how to find the median number using stl , given an integer array.
|
c********e 发帖数: 383 | 7 n!/(l!(n-l)!)
【在 f*z 的大作中提到】 : 第一题题目没看懂,那位给说一下,到底要做什么啊?
|
N***m 发帖数: 4460 | 8 这都什么啊?天书一样啊
【在 c********e 的大作中提到】 : n!/(l!(n-l)!)
|
l******e 发帖数: 12192 | 9 你是学数学出身的?
感觉你今天是来挖坑的
【在 N***m 的大作中提到】 : 这都什么啊?天书一样啊
|
r****t 发帖数: 10904 | 10 http://en.wikipedia.org/wiki/Combination
高中数学都忘了?
【在 f*z 的大作中提到】 : 第一题题目没看懂,那位给说一下,到底要做什么啊?
|
N***m 发帖数: 4460 | 11 我没看懂题目。
【在 l******e 的大作中提到】 : 你是学数学出身的? : 感觉你今天是来挖坑的
|