fix(sort): add c codes

This commit is contained in:
reanon 2023-01-18 14:20:42 +08:00
parent 744a37925f
commit d4d11d9f7d
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@
#include "../include/include.h"
/* 元素交换 */
static void swap(int nums[], int i, int j) {
void swap(int nums[], int i, int j) {
int tmp = nums[i];
nums[i] = nums[j];
nums[j] = tmp;

View file

@ -42,7 +42,7 @@ void countSort(int nums[], int size, int exp) {
}
/* 基数排序 */
static void radixSort(int nums[], int size) {
void radixSort(int nums[], int size) {
// 获取数组的最大元素,用于判断最大位数
int max = INT32_MIN;
for (size_t i = 0; i < size - 1; i++) {