leetcode-398-随机数索引-C语言

/* * 算法思想: * 蓄水池抽样算法,遍历整个数组,根据蓄水池抽样算法,决定当前元素的舍弃或者保留。 * */ typedef struct { int *arr; int len; } Solution; Solution* solutionCreate(int* nums, int numsSize) { int i; Solution* ob
相关文章
相关标签/搜索