Mission Base

Program Base Library Functions

void* pblListSet

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

Replaces the element at the specified position in this list with the specified element.

Documentation

Replaces the element at the specified position in this list with the specified element.

For array lists this method has a time complexity of O(1).

For linked lists this method has a time complexity of O(N), with N being the minimum of the differences between index and 0 or index and the size of the list. Therefore changing the first or last element has a time complexity of O(1), but changing a random element from the list has O(N).

Parameters:
list - The list to use
index - Index of element to replace
element - Element to be stored at the specified position
Returns:
void * retptr != (void*)-1: The element previously at the specified position, may be NULL.
void * retptr == (void*)-1: An error, see pbl_errno:
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++.