07 2022 档案

摘要:#include <stdio.h> #include <stdlib.h> void swap(int *x, int *y) { int t = *x; *x = *y; *y = t; } int partition(int arr[], int p, int q) { swap(arr + 阅读全文
posted @ 2022-07-04 00:05 张时雨 阅读(44) 评论(0) 推荐(0)
摘要:#include <stdio.h> const int pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}; #define get_digit(num, n) ((num) % 阅读全文
posted @ 2022-07-03 02:52 张时雨 阅读(23) 评论(0) 推荐(0)
摘要:#include <stdio.h> void counting_sort(const int arr[], int size, int target[], int k) { int count[k + 1]; for (int i = 0; i <= k; ++i) { count[i] = 0; 阅读全文
posted @ 2022-07-03 00:41 张时雨 阅读(24) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include <stdlib.h> void swap(int *x, int *y) { int t = *x; *x = *y; *y = t; } int partition(int arr[], int p, int q) { swap(arr + 阅读全文
posted @ 2022-07-02 23:03 张时雨 阅读(24) 评论(0) 推荐(0)
摘要:#include <stdio.h> void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; } int parent(int index) { return (index - 1) / 2; } int left(int index) { 阅读全文
posted @ 2022-07-02 19:38 张时雨 阅读(30) 评论(0) 推荐(0)