Update Array.cs to remove the empty line

This commit is contained in:
Ming 2022-12-14 19:42:39 +08:00 committed by GitHub
parent 94f66d3f06
commit f3430c059d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,14 @@
/* /*
* File: Array.cs * File: Array.cs
* Created Time: 2022-12-14 * Created Time: 2022-12-14
* Author: mingXta (1195669834@qq.com) * Author: mingXta (1195669834@qq.com)
*/ */
namespace hello_algo.chapter_arrag_and_linkedlist namespace hello_algo.chapter_arrag_and_linkedlist
{ {
public class Array public class Array
{ {
/* 随机返回一个数组元素 */ /* 随机返回一个数组元素 */
public static int RandomAccess(int[] nums) public static int RandomAccess(int[] nums)
{ {
Random random = new(); Random random = new();
@ -19,7 +18,6 @@ namespace hello_algo.chapter_arrag_and_linkedlist
} }
/* 扩展数组长度 */ /* 扩展数组长度 */
public static int[] Extend(int[] nums, int enlarge) public static int[] Extend(int[] nums, int enlarge)
{ {
// 初始化一个扩展长度后的数组 // 初始化一个扩展长度后的数组
@ -34,7 +32,6 @@ namespace hello_algo.chapter_arrag_and_linkedlist
} }
/* 在数组的索引 index 处插入元素 num */ /* 在数组的索引 index 处插入元素 num */
public static void Insert(int[] nums, int num, int index) public static void Insert(int[] nums, int num, int index)
{ {
// 把索引 index 以及之后的所有元素向后移动一位 // 把索引 index 以及之后的所有元素向后移动一位
@ -47,7 +44,6 @@ namespace hello_algo.chapter_arrag_and_linkedlist
} }
/* 删除索引 index 处元素 */ /* 删除索引 index 处元素 */
public static void Remove(int[] nums, int index) public static void Remove(int[] nums, int index)
{ {
// 把索引 index 之后的所有元素向前移动一位 // 把索引 index 之后的所有元素向前移动一位
@ -58,7 +54,6 @@ namespace hello_algo.chapter_arrag_and_linkedlist
} }
/* 遍历数组 */ /* 遍历数组 */
public static void Traverse(int[] nums) public static void Traverse(int[] nums)
{ {
int count = 0; int count = 0;
@ -75,7 +70,6 @@ namespace hello_algo.chapter_arrag_and_linkedlist
} }
/* 在数组中查找指定元素 */ /* 在数组中查找指定元素 */
public static int Find(int[] nums, int target) public static int Find(int[] nums, int target)
{ {
for (int i = 0; i < nums.Length; i++) for (int i = 0; i < nums.Length; i++)
@ -86,8 +80,7 @@ namespace hello_algo.chapter_arrag_and_linkedlist
return -1; return -1;
} }
/*辅助函数数组转字符串 */ /*辅助函数,数组转字符串 */
public static string ToString(int[] nums) public static string ToString(int[] nums)
{ {
return string.Join(",", nums); return string.Join(",", nums);