1660_冒泡排序II

2022-5-16 18:17| 发布者: Hocassian| 查看: 53| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-2-8950488134300-Problem List-采集的数据-后羿采集器.html

Pro.ID

1660

Title

冒泡排序II

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=1660

AC

92

Submit

215

Ratio

42.79%

时间&空间限制

  • Time Limit: 60000/40000 MS (Java/Others)     Memory Limit: 262144/262144 K (Java/Others)
  • 描述

    有 n 个无序的整数,试把它们从小到大排序。

    注:本题采用清华大学邓俊辉版的冒泡算法优化版,方可AC。

    定义向量数据结构如下:

    #define  MAX_SIZE  10000

    /// 简陋定义方式

    int myData[ MAX_SIZE ];   /// 向量元素存放的数组

    int mySize;   /// 向量元素的实际个数

    需要用到的函数原型有:

    int init ( )

    void traverse ( )

    int bubble ( int lo, int hi )

    void bubbleSort ( int lo, int hi )

    输入

    输入共有两行,第一行是一个整数 n ( 0 < n ≤ 10000 ),表示有n个整数。

    第二行是n个整数。

    输出

    Description

    有 n 个无序的整数,试把它们从小到大排序。

    注:本题采用清华大学邓俊辉版的冒泡算法优化版,方可AC。

    定义向量数据结构如下:

    #define  MAX_SIZE  10000

    /// 简陋定义方式

    int myData[ MAX_SIZE ];   /// 向量元素存放的数组

    int mySize;   /// 向量元素的实际个数

    需要用到的函数原型有:

    int init ( )

    void traverse ( )

    int bubble ( int lo, int hi )

    void bubbleSort ( int lo, int hi )

    Input

    输入共有两行,第一行是一个整数 n ( 0 < n ≤ 10000 ),表示有n个整数。

    第二行是n个整数。

    Output

    输出每一趟冒泡排序的结果,一趟一行。每个元素后面跟一个空格,作为分隔。

    Sample Input

    11
    11 1 2 5 3 4 7 8 9 10 12

    Sample Output

    1 2 5 3 4 7 8 9 10 11 12
    1 2 3 4 5 7 8 9 10 11 12
    1 2 3 4 5 7 8 9 10 11 12

    Source
    Author

    样例输入

    11
    11 1 2 5 3 4 7 8 9 10 12

    样例输出

    1 2 5 3 4 7 8 9 10 11 12
    1 2 3 4 5 7 8 9 10 11 12
    1 2 3 4 5 7 8 9 10 11 12

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部