Mission Base

Program Base Library Functions

PblSet* pblSetCloneRange

( PblSet* set,
  int fromIndex,
  int toIndex )

Returns a shallow copy from this set of all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.

Documentation

Returns a shallow copy from this set of all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.

For hash sets cloning from the beginning or the end of the set has a time complexity of O(M) with M being the number of elements cloned, while cloning from a random position in the middle of the set has a time complexity of O(N) with N being the number of elements in the set.

For tree sets cloning from the beginning or the end of the set has a time complexity of O(M * Log N), while cloning from a random position in the middle of the set has a time complexity of O(N * Log N) with N being the number of elements in the set and with M being the number of elements cloned.

This method has a memory complexity of O(M), with M being the number of elements cloned.

Parameters:
set - The set to use
fromIndex - The index of first element to be cloned.
toIndex - The index after last element to be cloned.
Returns:
PblSet * retPtr != NULL: A pointer to the new set.
PblSet * retPtr == NULL: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.
PBL_ERROR_OUT_OF_BOUNDS - fromIndex is out of range (fromIndex < 0 || fromIndex >= size()) or toIndex is out of range ( toIndex < 0 || toIndex > size()) or range is negative.

Alphabetic index



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