文章
10
粉丝
0
获赞
67
访问
7.7k
 
#include <stdio.h>
#include <string.h>
#include <malloc.h>
typedef struct Node{
    int a;  // 二元数组第一数据位
    int b;  // 二元数组第二数据位
    Node* next;
};
// 冒泡排序
void bubble_sort(int arr[],int N)
{
    int i,j,temp;
    for(i = 0;i<N-1;i++)
    {
        int swapped = 0;
        for(j = 0;j<N-i-1;j++)
        {
            if(arr[j]>arr[j+1])
            {
                temp = arr[j+1];
                arr[j+1] = arr[j];
                arr[j] = temp;
      ...
登录后发布评论
暂无评论,来抢沙发