Skip to content
本页目录

数组

详细的数组理论知识可以参考

常见题目

动态数组

基础的数组声明好长度之后就不可以改变,高级语言提供了动态数组,也可以叫列表,可以声明一个空的数组,然后逐步添加数据,长度可以动态扩展。
下面是 C# 提供的动态数组的使用方式:

csharp
// 初始化
IList<int> list = new List<int>();
IList<string> list = new List<string>();

// 获得元素个数 
list.Count

// 访问元素 
list[0]

// 删除元素
list.Remove(value)

Released under the MIT License.