30 lines
943 B
C
30 lines
943 B
C
#ifndef INCLUDED_C_HEAPSORT_H
|
|
#define INCLUDED_C_HEAPSORT_H
|
|
|
|
#ifndef INCLUDED_C_TYPES_H
|
|
#include <c_Types.h>
|
|
#endif /*INCLUDED_C_TYPES_H*/
|
|
|
|
#ifndef INCLUDED_C_SORTCOMPARE_H
|
|
#include <c_SortCompare.h>
|
|
#endif /*INCLUDED_C_SORTCOMPARE_H*/
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------------------------------------ */
|
|
/* */
|
|
|
|
|
|
/**
|
|
* @brief 工业级泛型就地堆排序(Floyd 线性建堆 + 常数级空间控制)
|
|
*
|
|
* @param base 指向待排序连续数组首元素的指针
|
|
* @param num 数组中元素的总个数
|
|
* @param size 每个元素所占用的内存字节大小 (sizeof)
|
|
* @param cmp 带自定义上下文参数的比对回调函数指针 (不能为 NULL)
|
|
* @param args 传递给比对回调函数的自定义上下文参数指针
|
|
*/
|
|
void c_HeapSort(void* base, c_size_t num, c_size_t size, c_SortCompare_t cmp, void* args);
|
|
|
|
#endif /*INCLUDED_C_HEAPSORT_H*/
|