请编写程序使用快速排序算法对数组中的数据进行降序排序。

日期:2017-07-08 11:10:14 人气:1

请编写程序使用快速排序算法对数组中的数据进行降序排序。

这是使用快速排序算法对数组中的数据进行降序排序的代码,每次运行随机生成 10 个数,C 语言递归实现。 #include #include #include void swap(int *x, int *y) { int t = *x; *x = *y; *y = t;}void quick_sort_recursive(int arr[], int start, int end) { if (start >= end) return; int mid =
    A+
热门评论