あなたの質問に答えるには:
確かに、C#のList<T>実装では、次のような内部配列を使用しています。
- シリアル化可能
- スレッドセーフ
- 実装
IEnumerable<T>(つまり、LINQクエリ、foreachedなど)
- バイナリ検索
等々
List<T>したがって、私はあなたにあなた自身のリストの代わりに使用するようにお願いします。
ああ、ところで、MicrosoftのソースコードがList<T>必要な場合は、ここにあります
List.cs
編集
EnsureCapacityinのソースコードList<T>は次のとおりです。
// Ensures that the capacity of this list is at least the given minimum
// value. If the currect capacity of the list is less than min, the
// capacity is increased to twice the current capacity or to min,
// whichever is larger.
private void EnsureCapacity(int min) {
if (_items.Length < min) {
int newCapacity = _items.Length == 0? _defaultCapacity : _items.Length * 2;
if (newCapacity < min) newCapacity = min;
Capacity = newCapacity;
}
}