mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-28 04:42:48 +08:00
build
This commit is contained in:
@ -813,6 +813,7 @@ comments: true
|
||||
fun remove(n0: ListNode?) {
|
||||
if (n0?.next == null)
|
||||
return
|
||||
// n0 -> P -> n1
|
||||
val p = n0.next
|
||||
val n1 = p?.next
|
||||
n0.next = n1
|
||||
|
@ -385,10 +385,10 @@ comments: true
|
||||
nums.Add(4);
|
||||
|
||||
/* 在中间插入元素 */
|
||||
nums.Insert(3, 6);
|
||||
nums.Insert(3, 6); // 在索引 3 处插入数字 6
|
||||
|
||||
/* 删除元素 */
|
||||
nums.RemoveAt(3);
|
||||
nums.RemoveAt(3); // 删除索引 3 处的元素
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
@ -445,10 +445,10 @@ comments: true
|
||||
nums.push(4);
|
||||
|
||||
/* 在中间插入元素 */
|
||||
nums.splice(3, 0, 6);
|
||||
nums.splice(3, 0, 6); // 在索引 3 处插入数字 6
|
||||
|
||||
/* 删除元素 */
|
||||
nums.splice(3, 1);
|
||||
nums.splice(3, 1); // 删除索引 3 处的元素
|
||||
```
|
||||
|
||||
=== "TS"
|
||||
@ -465,10 +465,10 @@ comments: true
|
||||
nums.push(4);
|
||||
|
||||
/* 在中间插入元素 */
|
||||
nums.splice(3, 0, 6);
|
||||
nums.splice(3, 0, 6); // 在索引 3 处插入数字 6
|
||||
|
||||
/* 删除元素 */
|
||||
nums.splice(3, 1);
|
||||
nums.splice(3, 1); // 删除索引 3 处的元素
|
||||
```
|
||||
|
||||
=== "Dart"
|
||||
|
Reference in New Issue
Block a user