Linux Kernel
3.7.1
|
#include <linux/types.h>
Go to the source code of this file.
Functions | |
void | list_sort (void *priv, struct list_head *head, int(*cmp)(void *priv, struct list_head *a, struct list_head *b)) |
void list_sort | ( | void * | priv, |
struct list_head * | head, | ||
int(*)(void *priv, struct list_head *a, struct list_head *b) | cmp | ||
) |
list_sort - sort a list : private data, opaque to list_sort(), passed to : the list to sort : the elements comparison function
This function implements "merge sort", which has O(nlog(n)) complexity.
The comparison function must return a negative value if should sort before , and a positive value if should sort after . If and are equivalent, and their original relative ordering is to be preserved, must return 0.
Definition at line 97 of file list_sort.c.