text: public override void Add(int index, T element){if (index == size){AddItem(element);}else{if (index < 0 || size < index){throw new IndexOutOfRangeException(index.ToString());}else{AddItem(default(T));for (int oldIdx = size - 2; index <= oldIdx; oldIdx--){Set(oldIdx + 1, this[oldIdx]);}Set(index, element);}}}