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
@@ -5,7 +5,7 @@
namespace hello_algo.chapter_array_and_linkedlist;
public class array {
/* 随机返回一个数组元素 */
/* 随机访问元素 */
public static int randomAccess(int[] nums) {
Random random = new();
// 在区间 [0, nums.Length) 中随机抽取一个数字
@@ -9,8 +9,8 @@ namespace hello_algo.chapter_stack_and_queue;
/* 双向链表节点 */
public class ListNode {
public int val; // 节点值
public ListNode? next; // 后继节点引用(指针)
public ListNode? prev; // 前驱节点引用(指针)
public ListNode? next; // 后继节点引用
public ListNode? prev; // 前驱节点引用
public ListNode(int val) {
this.val = val;