惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Palo Alto Networks Blog
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
C
Cisco Blogs
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
Simon Willison's Weblog
Simon Willison's Weblog
T
Tenable Blog
Know Your Adversary
Know Your Adversary
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
月光博客
月光博客
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threat Research - Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
D
Darknet – Hacking Tools, Hacker News & Cyber Security
W
WeLiveSecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
U
Unit 42
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
Attack and Defense Labs
Attack and Defense Labs
罗磊的独立博客
T
The Exploit Database - CXSecurity.com
I
Intezer
GbyAI
GbyAI
Jina AI
Jina AI
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Google Online Security Blog
Google Online Security Blog
Engineering at Meta
Engineering at Meta
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
小众软件
小众软件
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
Project Zero
Project Zero

博客园 - Forrest Gump

关于LINQ中数据库连接字符串的问题 项目开发经验-ASP.NET项目开发中的异常处理 关于模态窗口(showModalDialog)的专题【收藏】 C#面试题 C# 将数据导出到Excel汇总 关于Assembly.CreateInstance()与Activator.CreateInstance()方法 PowerDesigner概念设计模型(CDM)中的3种实体关系 C#基础概念二十五问 Microsoft .NET Pet Shop 4:将 ASP.NET 1.1 应用程序迁移到 2.0 用Inno Setup制作WEB程序安装包 冒泡法数组排序与 System.Array.Sort()排序性能比较 堆排序 (Heap sort) 合并排序法(Merge Sort) 希尔排序法 关于switch的小技巧 C#中一些很基础但有经常导致错误的一些概念 Enterprise Library Step By Step系列(十六):使用AppSetting Application Block Enterprise Library Step By Step系列(十五):配置应用程序块——设计篇 创建基于消息队列(MSMQ)的异步日志
quick sort
Forrest Gump · 2008-01-28 · via 博客园 - Forrest Gump

 1using System;
 2namespace MyQSort{
 3 public class QSort //可以写成static public class QSort
 4 {
 5  private static int[] toBeSort;
 6  private static void swap(int a,int b){
 7   int c;
 8   c=toBeSort[a];
 9   toBeSort[a]=toBeSort[b];
10   toBeSort[b]=c;
11  }

12  ///<sumary>
13  ///分割函数
14  ///</sumary>

15  private static int Partition(int low,int high){
16   int pivoKey=toBeSort[low];
17   while(low<high){
18    while(low<high && (toBeSort[high] >= pivoKey)) --high;
19    swap(low,high);
20    while(low<high && (toBeSort[low] <= pivoKey))  ++low;
21    swap(low,high);
22   }

23   return low;
24  }

25  private static void QQSort(int low,int high){
26   int pivoLoc;
27   if(low<high){
28    pivoLoc=Partition(low,high);
29    QQSort(low,pivoLoc-1);
30    QQSort(pivoLoc+1,high);
31   }

32  }

33  public static int[] QuickSort(int [] a){
34   toBeSort=a;
35   QQSort(0,toBeSort.Length-1);
36   return toBeSort;
37  }

38
39 }
;
40}

41