mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Improve the consistency between code and comments in Kotlin (#1268)
* style(kotlin): Make code and comments consistent. * style(kotlin): convert comment location. * style(c): Add missing comment. * style(kotlin): Remove redundant semicolon, parenthesis and brace * style(kotlin): Put constants inside the function. * style(kotlin): fix unnecessary indentation. * style(swift): Add missing comment. * style(kotlin): Add missing comment. * style(kotlin): Remove redundant comment. * style(kotlin): Add missing comment. * Update linked_list.kt * style(csharp,js,ts): Add missing comment. * style(kotlin): Remove empty lines. * Update list.cs * Update list.js * Update list.ts * roll back to commit 1 * style(cs,js,ts): Add missing comment in docfile. * style(kotlin): Use normal element swapping instead of scope functions.
This commit is contained in:
@ -379,10 +379,10 @@
|
||||
nums.Add(4);
|
||||
|
||||
/* 在中间插入元素 */
|
||||
nums.Insert(3, 6);
|
||||
nums.Insert(3, 6); // 在索引 3 处插入数字 6
|
||||
|
||||
/* 删除元素 */
|
||||
nums.RemoveAt(3);
|
||||
nums.RemoveAt(3); // 删除索引 3 处的元素
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
@ -439,10 +439,10 @@
|
||||
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"
|
||||
@ -459,10 +459,10 @@
|
||||
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"
|
||||
|
||||
@ -117,7 +117,7 @@
|
||||
```kotlin title=""
|
||||
/* 二叉树的数组表示 */
|
||||
// 使用 null 来表示空位
|
||||
val tree = mutableListOf( 1, 2, 3, 4, null, 6, 7, 8, 9, null, null, 12, null, null, 15 )
|
||||
val tree = arrayOf( 1, 2, 3, 4, null, 6, 7, 8, 9, null, null, 12, null, null, 15 )
|
||||
```
|
||||
|
||||
=== "Ruby"
|
||||
|
||||
Reference in New Issue
Block a user