Files
cKit/Sort/c_ShellSort.h
2026-08-30 22:24:45 +08:00

24 lines
889 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef INCLUDED_C_SHELLSORT_H
#define INCLUDED_C_SHELLSORT_H
#ifndef INCLUDED_C_SORTCOMPARE_H
#include <c_SortCompare.h>
#endif /*INCLUDED_C_SORTCOMPARE_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
/**
* @brief 工业级泛型希尔排序(基于 Knuth 步长序列:h = 3*h + 1,支持上下文参数 args
*
* @param base 指向待排序连续数组首元素的指针
* @param num 数组中元素的总个数
* @param size 每个元素所占用的内存字节大小 (sizeof)
* @param cmp 带自定义上下文参数的比对回调函数指针 (不能为 NULL)
* @param args 传递给比对回调函数的自定义上下文参数指针
*/
void c_ShellSort(void* base, c_size_t num, c_size_t size, c_SortCompare_t cmp, void* args);
#endif /*INCLUDED_C_SHELLSORT_H*/