哈妙思 发表于 昨天 10:33

数据结构-排序

为给定的数组按照升序进行排序,排序过程中,不定义新的数组,用插入的方式实现
/*************************************************************************** 设计升序排序的接口***author:jindouliu2024@163.com *date:2025.4.8** Copyright (c)2024-2025   jindouliu2024@163.com   All right Reserved* ************************************************************************/#includevoid swap(int buf[],int bufsize){        int data;        //假定第一个元素的值是最小的,从第二个元素开始遍历        for(int i=1;i=0;j--){                        if(buf
页: [1]
查看完整版本: 数据结构-排序