* used in place of the one given to this function is
* returned. Otherwise, the old pointer is returned. See eina_error_get().
*
- * @note O(log2(n)) average/worst case performance as it uses
- * eina_list_search_sorted_near_list() and thus is bounded to that.
+ * @note O(log2(n)) comparisons (calls to func) average/worst case
+ * performance as it uses eina_list_search_sorted_near_list() and thus
+ * is bounded to that. As said in eina_list_search_sorted_near_list(),
+ * lists do not have O(1) access time, so walking to the correct node
+ * can be costly, consider worst case to be almost O(n) pointer
+ * dereference (list walk).
*/
EAPI Eina_List *
eina_list_sorted_insert(Eina_List *list, Eina_Compare_Cb func, const void *data)
* @note @b in-place: this will change the given list, so you should
* now point to the new list head that is returned by this function.
*
- * @note worst case is O(n * log2(n)), O(n) average case. That means
- * that for 1,000,000 list elements, sort will usually do 1,000,000
- * comparisons, but may do up to 20,000,000.
+ * @note worst case is O(n * log2(n)) comparisons (calls to func()),
+ * O(n) comparisons average case. That means that for 1,000,000 list
+ * elements, sort will usually do 1,000,000 comparisons, but may do up
+ * to 20,000,000.
*
* Example:
* @code
* faster than the 1,000,000 comparisons made naively walking the list
* from head to tail, so depending on the number of searches and
* insertions, it may be worth to eina_list_sort() the list and do he
- * searches later.
+ * searches later. As lists do not have O(1) access time, walking to
+ * the correct node can be costly, consider worst case to be almost
+ * O(n) pointer dereference (list walk).
*
* @see eina_list_search_sorted_list()
* @see eina_list_sort()
* faster than the 1,000,000 comparisons made by
* eina_list_search_unsorted_list(), so depending on the number of
* searches and insertions, it may be worth to eina_list_sort() the
- * list and do he searches later.
+ * list and do he searches later. As said in
+ * eina_list_search_sorted_near_list(), lists do not have O(1) access
+ * time, so walking to the correct node can be costly, consider worst
+ * case to be almost O(n) pointer dereference (list walk).
*
* @see eina_list_search_sorted()
* @see eina_list_sort()
* @see eina_list_sorted_merge()
* @see eina_list_search_unsorted_list()
+ * @see eina_list_search_sorted_near_list()
*/
EAPI Eina_List *
eina_list_search_sorted_list(const Eina_List *list, Eina_Compare_Cb func, const void *data)
* faster than the 1,000,000 comparisons made by
* eina_list_search_unsorted(), so depending on the number of
* searches and insertions, it may be worth to eina_list_sort() the
- * list and do he searches later.
+ * list and do he searches later. As said in
+ * eina_list_search_sorted_near_list(), lists do not have O(1) access
+ * time, so walking to the correct node can be costly, consider worst
+ * case to be almost O(n) pointer dereference (list walk).
*
* @see eina_list_search_sorted_list()
* @see eina_list_sort()