Sets an application specific compare function for the elements of the list.
Sets an application specific compare function for the elements of the list.An application specific compare function can be set to the list. If no specific compare function is specified by the user, the default compare function is used. The default compare function compares the two pointers directly, i.e. it tests for object identity.
The compare function specified should behave like the one that can be specified for the C-library function 'qsort'.
The arguments actually passed to the compare function when it is called are addresses of the element pointers added to the list. E.g.: If you add char * pointers to the list, the compare function will be called with char ** pointers as arguments. See the documentation for the C-library function 'qsort' for further information.
This method has a time complexity of O(1).