登录
首页 » 算法 » 冒泡法 起泡法 用使数组排列

冒泡法 起泡法 用使数组排列

于 2023-04-24 发布 文件大小:209.26 kB
0 198
下载积分: 2 下载次数: 1

代码说明:

C语言冒泡法(起泡法)排序 思路:将相邻的两个数进行比较,将小的调到前头。 如果有n个数,那么要进行n-1次的比较。在第一次比较中要进行n-1次的两两比较,在第j次比较中要进行n-j次的两两比较。 过程:先通过动态赋值的方法,把用户输入的10个数字保存到数组中。 用两个for循环语句,外层循环是限制次数,内层循环限制某次要进行两两比较的次数。 如果a[n]>a[n+1],那么将两个数进行交换。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • a description of the problem is : No. 1, 2, ..., n n clockwise direction by indi...
    约瑟夫问题的一种描述是:编号为1,2,…,n的n个人按顺时针方向围坐一圈,没人持有一个密码。一开始人选一个正整数作为报数上限值m,从第一个人开始按顺时针自1开始报数,报到m是停止报数。报m的人出列,将他的密码作为新的m值,从他在顺时针方向上的下一个人开始重新从1报数,如此下去,直至所有人全部出列为止。-a description of the problem is : No. 1, 2, ..., n n clockwise direction by individuals sitting around a circle, no one holding a password. One person started as a positive integer limits on the number of reported m, from the first individuals to embark on the clockwise from a few reportedly started, the report m is reportedly stopped a few. M reported out of the list of his password as a new value m, from a clockwise direction in the next re-started from a newspaper a few, like that, until the total of all listed so far.
    2022-02-03 16:31:48下载
    积分:1
  • 三点的插值函数的fortran90程序,包括源代码,一个例和输出文件,简单适用。...
    计算三点的插值函数的fortran90程序,包括源代码,一个算例和输出文件,简单适用。-Calculating a three-point interpolation function fortran90 procedures, including source code, a numerical example and output files, simple and applicable.
    2022-02-27 08:32:48下载
    积分:1
  • Mean
    Mean-shift聚类算法详细介绍,里面有丰富的图片和图形-Mean-shift clustering algorithm detail, which is rich in pictures and graphics
    2023-04-13 18:10:04下载
    积分:1
  • 最优化问题:变尺度求最多元非线性函数的最值问题
    最优化问题:变尺度算法求最多元非线性函数的最值问题-optimization problem : Changing the scaling algorithm for the nonlinear function of the value problems
    2023-01-11 00:15:03下载
    积分:1
  • 积分
    不定积分 输入x1,f(x1),x2,f(x2)...输出F(x1),F(x2)... 用二分法和sinx求π.sinx用泰勒展开逼近。-integral
    2022-10-16 01:20:03下载
    积分:1
  • java打飞机源码
    用java做的一个打飞机的小游戏,这是整个工程包,里面有所有需要的.java .class文件,可以直接导入到myeclipse下运行 谢谢大家下载,不要乱传 顶一个。。。。哈哈哈啊哈哈哈哈哈
    2023-06-03 21:55:04下载
    积分:1
  • 标准C写的数据直线拟合,最小二乘处理,自己写的
    标准C写的数据直线拟合,最小二乘法处理,自己写的-write C standard linear data fitting, least squares method, wrote it myself
    2023-07-10 07:20:03下载
    积分:1
  • Schrodinger Equation numerical calculation equation
    Schrodinger Equation 数值计算中的方程-Schrodinger Equation numerical calculation equation
    2022-04-17 00:16:20下载
    积分:1
  • 高 斯 消元,n 阶 线性 解
    高 斯 消元法,n 阶 线性 解法-斯 元 n 夥
    2023-07-15 23:45:03下载
    积分:1
  • 决策理论
    应用背景程序包含了解决任务的方法 ; ;决策理论。路径(路径查找)的任务。有3种算法:deikstra,A*,最好先。你可以用一个图,时间,点菜单 ;“帮助”也做“开始”,“暂停”,“停止”。图中有很多颜色的线,所以可以清楚地看到,正确的决策。好运!关键技术程序语言:C #  ;视觉工作室窗口形式使用委托,类,类方法,功能,和;枚举等。
    2022-05-31 03:41:23下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载