Mission Base

Program Base Library Functions

void* pblListGet

( PblList* list, int index )

Returns the element at the specified position in this list.

Documentation

Returns the element at the specified position in this list.

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 retrieving the first or last element has a time complexity of O(1), but retrieving a random element from the list has O(N).

Parameters:
list - The list to use
index - Index of the element to return
Returns:
void * retptr != (void*)-1: The element at the specified position in this list, 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++.