#include <stdio.h>
#include <string.h> int a[110000]; void qusort(int l, int r, int a[])
{
int i = l, j = r;
int x = a[i];
if(i >= j) return ;
while(i < j)
{
while(i < j && a[j] >= x) j --;
a[i] = a[j];
while(i < j && a[i] <= x) i ++;
a[j] = a[i];
}
a[i] = x; // qusort(l,i-1,a); // kuaipai
// qusort(i+1,r,a);
}
int main()
{
int n;
while(scanf("%d",&n) != EOF)
{
for(int i = 0; i < n; i ++)
{
scanf("%d",&a[i]);
}
qusort(0,n-1,a);
for(int i = 0; i < n; i ++)
{
if(i == 0) printf("%d",a[i]);
else printf(" %d",a[i]);
}
printf("\n");
}
return 0 ;
}

数据结构实验之排序一:一趟快排( SDUT 3398)的更多相关文章

  1. 数据结构实验之排序四:寻找大富翁(SDUT 3401)

    #include <stdio.h> #include <stdlib.h> #include <string.h> void Swap(int a[], int ...

  2. 数据结构实验之排序七:选课名单 (SDUT 3404)

    #include <stdio.h> #include <string.h> #include <stdlib.h> struct node { char data ...

  3. SDUT OJ 数据结构实验之排序一:一趟快排

    数据结构实验之排序一:一趟快排 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descrip ...

  4. SDUT 3398 数据结构实验之排序一:一趟快排

    数据结构实验之排序一:一趟快排 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 给定N个长整 ...

  5. SDUT-3398_数据结构实验之排序一:一趟快排

    数据结构实验之排序一:一趟快排 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 给定N个长整型范围内的整数,要求输出以给 ...

  6. SDUT OJ 数据结构实验之排序二:交换排序

    数据结构实验之排序二:交换排序 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descrip ...

  7. SDUT OJ 3403 数据结构实验之排序六:希尔排序

    数据结构实验之排序六:希尔排序 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Descrip ...

  8. SDUT 3402 数据结构实验之排序五:归并求逆序数

    数据结构实验之排序五:归并求逆序数 Time Limit: 40MS Memory Limit: 65536KB Submit Statistic Problem Description 对于数列a1 ...

  9. SDUT 3399 数据结构实验之排序二:交换排序

    数据结构实验之排序二:交换排序 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 冒泡排序和快 ...

  10. SDUT-3399_数据结构实验之排序二:交换排序

    数据结构实验之排序二:交换排序 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 冒泡排序和快速排序都是基于"交 ...

随机推荐

  1. VisualStudio 连接 MySql 实现增删查改

    首先创建数据库,建立一个用户登录表 2.visualStudio默认是不支持MySql的,要想通过Ado.Net 操作MySql 需要在管理NeGet包添加对MySql.Data  和 MySql.D ...

  2. 2.9_Database Interface ADO结构组成及连接方式实例

    说通俗点OLE DB和ODBC都是最底层的东西,而ADO对象给我们提供了一个“可视化”和应用层直接交互的组件,ADO对象T通过OLE DB间接取得数据库中的数据,如下图: 从上面看出,可以说ADO是应 ...

  3. web API .net - .net core 对比学习-使用Swagger

    根据前两篇的介绍,我们知道.net web api 和 .net core web api在配置方面的不同如下: 1. .net web api的配置是在 App_Stat文件夹里面添加对应的配置类, ...

  4. Jsp页面显示时间:<fmt>标签问题

    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%> <%@ taglib ...

  5. 修改CentOS默认yum源为国内镜像

    参考文档 https://blog.csdn.net/inslow/article/details/54177191 国内主要开源的开源镜像站点应该是网易和阿里云了. 修改为163yum源-mirro ...

  6. 解决此报错:Cannot create Woodstox XMLInputFactory: java.lang.NoClassDefFoundError: com/ctc/wstx/stax/WstxInput

    最近在研究webservice服务的技术,可是写完webservice例子后,项目正常启动,但是在输入url地址后报如下的错误: Cannot create Woodstox XMLInputFact ...

  7. 关于UIImageView缓存加载的笔记

    加载图片的两个方法: [UIImage imageNamed:] [[UIImage alloc] initWithContentsOfFile: imgpath] [UIImage imageNam ...

  8. SQL+C#:一次多语言混合编程的经验总结

    1.用JAVA做,采取轮询策略: 2.用sql语言+C#混合编程,采取触发策略

  9. python 笔记二

    17.进程线程 进程间通信方式:管道Pipe:队列Queue:共享内存Value.Array.Manager: 多进程同步:锁Lock.递归锁RLock.Condition(条件变量):事件event ...

  10. springboot使用过滤器Filter

    先创建过滤器配置类: ## 引入的包部分省略... @Configuration public class FilterConfig { @SuppressWarnings({"rawtyp ...