mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
Polish the chapter of array and linkedlist
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
|
||||
#include "../utils/common.hpp"
|
||||
|
||||
/* 随机返回一个数组元素 */
|
||||
/* 随机访问元素 */
|
||||
int randomAccess(int *nums, int size) {
|
||||
// 在区间 [0, size) 中随机抽取一个数字
|
||||
int randomIndex = rand() % size;
|
||||
|
Reference in New Issue
Block a user