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

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

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

代码说明:

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

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

发表评论

0 个回复

  • A* K短路
      所谓K短路,就是从s到t的第K短的路,第1短就是最短路。     如何求第K短呢?有一种简单的方法是广度优先搜索,记录t出队列的次数,当t第k次出队列时,就是第k短路了。但点数过大时,入队列的节点过多,时间和空间复杂度都较高。     A*是在搜索中常用的优化,一种启发式搜索。简单的说,它可以用公式表示为f(n) = g(n) + f(n),其中,f(n)是从s经由节点n到t的估价函数,g(n)是在状态空间中从s到n的实际代价,h(n)是从n到t的最佳路径估计代价。在设计中,要保证h(n)
    2023-06-26 04:50:02下载
    积分:1
  • 由于对两次以上的高次函数求解比较不方便 本程序将为你提供便捷...
    由于对两次以上的高次函数求解比较不方便 本程序将为你提供便捷-due to more than two high-function solution more inconvenient this program will provide you with convenient
    2022-07-17 19:02:19下载
    积分:1
  • 提供一个直接搜索程序,具有全局寻优能力。
    提供一个直接搜索算法程序,具有全局寻优能力。-provide a direct search procedures, and have an overall optimization capabilities.
    2022-07-16 12:31:33下载
    积分:1
  • 敏感词wordbank
    package com.yaozhou.sensitive.wordbank;import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.util.ArrayList;import java.util.HashMap;import java.util.HashSet;import java.util.LinkedList;import java.util.List;import java.util.Map;import java.util.Properties;import java.util.Set;/** * @author Yao.Zhou* @version 创建时间:2016年12月21日 上午11:08:23 * 类说明 */@SuppressWarnings("unused")public class SensitiveWordBank {private static final String ENCODE = "UTF-8";private File path;private Map wordBankContainer;public SensitiveWordBank(String dir) {
    2022-01-26 05:07:53下载
    积分:1
  • newton interpolation
    newton interpolation
    2023-01-22 18:45:04下载
    积分:1
  • 双曲Householder变换的功能类似于主跨…
    hyperbolic Householder transformation的功能类似于Householder transformation,其作用是将被变换向量映射成双曲模与之相同的其它向量。其应用之一是快速QR分解。-hyperbolic Householder transformation functions similar to the Householder transformation, its role is to transform vectors will be mapped into hyperbolic mode with the same other vector. One of their applications are fast QR decomposition.
    2022-06-14 03:01:36下载
    积分:1
  • 分段线性分割的,用于进行自底向上的分段线性时间序列分割...
    分段线性分割的算法,用于进行自底向上的分段线性时间序列分割-Piecewise linear segmentation algorithm, bottom-up used for the Piecewise Linear Time Series Segmentation
    2022-07-23 22:28:08下载
    积分:1
  • C#计
    using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.InteropServices; using System.IO; namespace 计算器 { /// /// Form1 的摘要说明。 /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button7; private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button9; private System.Windows.Forms.Button button11; private System.Windows.For
    2023-01-30 17:15:03下载
    积分:1
  •  本程序是在原来的单纯形基础上改进的,主要用于分枝界定求解的整数规划。  修正的地方:   1.运用勃兰特原则   2.人机互动...
     本程序是在原来的单纯形法基础上改进的,主要用于分枝界定法求解的整数规划。  修正的地方:   1.运用勃兰特原则   2.人机互动-this procedure is in the original simplex method on the basis of improvement, mainly for Mycobacterium defined method of integer programming. The amendment : 1. Using the principle of two Brandt. Human-Computer Interaction
    2023-06-21 20:30:03下载
    积分:1
  • BP神经网络的逼近函数源代码 数学建模
    BP神经网络的逼近函数源代码 数学建模-BP neural network approximation function of the source code for mathematical modeling
    2023-01-09 08:40:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载