Mission Base

Program Base Library Functions

int pblListRemoveRange

( PblList* list, int fromIndex,
  int toIndex )

Removes from this list all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.

Documentation

Removes from this list all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)

Note: No memory of the elements themselves is freed.

For array lists removing from the end of the list has a time complexity of O(M), while removing from the beginning of the list has a time complexity of O(N + M) with N being the number of elements in the list and M being the number of elements removed.

For linked lists removing from the beginning or the end of the list has a time complexity of O(M), while removing from a random position in the middle of the list has a time complexity of O(N + M) with N being the number of elements in the list and M being the number of elements removed.

Parameters:
list - The list to use
fromIndex - The index of first element to be removed.
toIndex - The index after last element to be removed.
Returns:
int rc >= 0: The size of the list.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_BOUNDS - fromIndex is out of range (fromIndex < 0 || fromIndex >= size()) or toIndex is out of range ( toIndex < 0 || toIndex > size())

Alphabetic index



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