Inserts a new item at the given index in the Deque. All items at indexes
equal to or greater than index move up one index
in the Deque.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic override sealed void Insert(
int index,
T item
)
public:
virtual void Insert(
int index,
T item
) override sealed
Parameters
- index
- Type: SystemInt32
The index in the Deque to insert the item at. After the
insertion, the inserted item is located at this index. The
front item in the Deque has index 0. - item
- Type: T
The item to insert at the given index.
Implements
IListTInsert(Int32, T)
Exceptions
RemarksThe amount of time to insert an item in the Deque is proportional
to the distance of index from the closest end of the Deque:
O(Min(index, Count - index)).
Thus, inserting an item at the front or end of the Deque is always fast; the middle of
of the Deque is the slowest place to insert.
See Also