Polish the chapter of array and linkedlist

This commit is contained in:
krahets
2023-08-17 05:13:19 +08:00
parent 0858ab91c0
commit c310edb672
26 changed files with 287 additions and 236 deletions

View File

@ -4,7 +4,7 @@
* Author: IsChristina (christinaxia77@foxmail.com)
*/
/* 随机返回一个数组元素 */
/* 随机访问元素 */
function randomAccess(nums) {
// 在区间 [0, nums.length) 中随机抽取一个数字
const random_index = Math.floor(Math.random() * nums.length);