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

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

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

代码说明:

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

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

发表评论

0 个回复

  • 非线性方程不能消除和分解方求解,…
    非线性方程组不能用消去和分解法进行求解,jacabi迭代和高斯迭代是最常用的两种迭代方法-Nonlinear equations can not be eliminated and the decomposition method to solve, jacabi iteration and Gauss iteration is the most commonly used two types of iterative methods
    2022-01-26 07:01:24下载
    积分:1
  • LU分解解方程-Fortran
    利用LU分解方法,计算线性方程的解,Fortran程序!
    2022-04-21 16:17:07下载
    积分:1
  • AT24c04读写程序
    AT24c04测试用代码,串口打印,方便查看,使用STC单片机,模拟I2C总线,对于初学者有点一定帮助作用,可以同时了解I2C和串口通信
    2022-12-12 08:55:03下载
    积分:1
  • 伯肃叶流动用格子boltzmann方去扩展新的研究方
    伯肃叶流动用格子boltzmann方法去扩展新的研究方法-Peter Stephen leaf lattice boltzmann method flow go with the expansion of new research methods
    2022-10-15 11:15:03下载
    积分:1
  • 交通仿真(排队论)小程序
    This is the project of my course in the USA: Customers arrive at a service station (with a single server) according to the Poisson process with a mean arrival rate of lambda = 0.3 (customers/min). Each customer waits in queue (if present), proceeds to receive service upon his/her turn, and departs the system when the service is completed. The service time is uniformly distributed between 2.5 and 4.5 minutes. On each day, the service station is open for two hours. Any customers in queue at the end of work hours are served before closing the service station for the day. Use simulation (do 100 simulation runs) to determine
    2023-02-02 14:55:04下载
    积分:1
  • C#数据计
    资源描述C#涉及的相关数据计算方法,内容很丰富,包括Complex、Integral、Interpolation、LEquations、Matrix、NLEquations等等算法,里面还有很多例子,很不错的基于C#的相关数学计算方法,个人觉得很有用。
    2022-03-13 05:18:21下载
    积分:1
  • 最小不重复数问题
    问题描述:给定一个数n,找出大于这个数的最小不重复数(任意相邻位数字不相同)。 程序给出了两种方法:find和find1,其中find1属于暴力法,直接从n+1开始寻找,每次加1,知道找到满足条件的不重复数为止。 第二种方法比较巧妙,将n各位数字存到一个数组a[]里,下标大小对应位数高低,比如1234,数组a[0...3]依次为1,2,3,4;从最高位开始找相邻的重复数,较低的重复位加1带进位,高位循环加进位直到无进位,低位置零;回到次高位重新寻找重复位,直到无重复位。
    2022-05-13 23:24:34下载
    积分:1
  • In this note we make a critical comparison of some matlab programs for the digit...
    详细表述了分数阶傅立叶变换的离散实现,将现有的算法进行比较。-In this note we make a critical comparison of some matlab programs for the digital computation of the fractional Fourier transform that are freely available and we describe our own implementation that lters the best out of the existing ones. Two types of transforms are considered: First the fast approximate fractional Fourier transform algorithm for which two algorithms are available. The method is described in H.M. Ozaktas, M.A. Kutay, and G. Bozdagi. Digital computation of the fractional Fourier transform. IEEE Trans. Signal Process., 44:2141{2150, 1996. There are two implementations: one is written by A.M. Kutay the other is part of package written by J. O Neill. Secondly the discrete fractional Fourier transform algorithm described in the master thesis C . Candan. The discrete fractional Fourier transform, Bilkent Univ., 1998 and an algorithm described by S.C. Pei, M.H. Yeh, and C.C Tseng: Digital fractional Fourier transform base
    2022-02-09 21:16:41下载
    积分:1
  • 基于SIFT特征提取的SVM分类
    基于SIFT的特征提取的SVM分类算法研究,SVM采用libsvm 提供的接口程序。SIFT采用opencv提供的SIFT特征提取函数进行提取,该算法针对小图片进行训练和识别有较好的效果
    2022-06-17 03:35:28下载
    积分:1
  • JAVA数据结构之HASH编码的小应用程序
    JAVA数据结构之HASH编码的小应用程序-Java data structures hash coding of small applications
    2022-06-01 18:16:24下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载