Mission Base

Program Base Library Functions

int pblListAddAt

( PblList* list, int index, void* element )

Inserts the specified element at the specified position in this list.

Documentation

Inserts the specified element at the specified position in this list.

Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

For array lists adding to the end of the list has a time complexity of O(1), while adding to the beginning of the list has a time complexity of O(N) with N being the number of elements in the list.

For linked lists adding to beginning or the end of the list has a time complexity of O(1), while adding to a random position in the middle of the list has a time complexity of O(N) with N being the number of elements in the list.

Parameters:
list - The list to use
index - Index at which the element is to be inserted
element - Element to be appended to this list
Returns:
int rc >= 0: The size of this list instance.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.
PBL_ERROR_OUT_OF_BOUNDS - Index is out of range (index < 0 || index >= size()).

Alphabetic index



This page was generated with the help of DOC++.