Search / Sort

This commit is contained in:
2026-08-30 22:24:45 +08:00
parent 3a4717a9d8
commit 0cb98557da
75 changed files with 7570 additions and 7 deletions
+29
View File
@@ -0,0 +1,29 @@
#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*/