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
+23
View File
@@ -0,0 +1,23 @@
#ifndef INCLUDED_C_BINARYINSERTIONSORT_H
#define INCLUDED_C_BINARYINSERTIONSORT_H
#ifndef INCLUDED_C_SORTCOMPARE_H
#include <c_SortCompare.h>
#endif /*INCLUDED_C_SORTCOMPARE_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
/**
* @brief 泛型二分插入排序(大幅降低比对次数,完全规避无符号整数下溢)
*
* @param base 指向待排序连续数组首元素的指针
* @param num 数组中元素的总个数
* @param size 每个元素所占用的内存字节大小 (sizeof)
* @param cmp 比对回调函数指针 (不能为 NULL)
*/
void c_BinaryInsertionSort(void* base, c_size_t num, c_size_t size, c_SortCompare_t cmp, void* args);
#endif /*INCLUDED_C_BINARYINSERTIONSORT_H*/