选择排序法
来源:互联网 发布:ehviewer大图网络错误 编辑:程序博客网 时间:2024/04/30 05:52
int[] arr = new int[] { 3, 6, 14, 65, 2, 7, 93, 1, 55 }; //选择排序法
foreach (int n in arr)
Console.Write("{0}", n + " ");
Console.WriteLine();
int min;
for (int i = 0; i < arr.Length - 1; i++)
{
min = i;
for (int j = i + 1; j < arr.Length; j++)
{
if (arr[j] < arr[min])
min = j;
}
int t = arr[min];
arr[min] = arr[i];
arr[i] = t;
}
Console.WriteLine("排序后结果为: ");
foreach (int n in arr)
Console.Write("{0}",n+" ");
Console.WriteLine();
- 常用排序-选择法排序
- 常见排序-选择法排序
- 排序算法--选择排序法
- 按选择排序法排序。
- 排序模板 选择法排序
- 排序算法--选择排序法
- 排序之选择排序法
- 选择排序法法
- 排序:选择法
- 选择排序法
- 选择法排序
- 选择排序法
- 选择排序法证明
- 选择排序法
- 选择排序法
- 选择排序法
- 选择排序法
- C++ 选择排序法
- PMP: Project Management Professional Exam Study Guide
- Complete PCB Design Using OrCad Capture and Layout
- Beginning PHP and Oracle: From Novice to Professional
- 给Netscape的安慰,回首Firefox 4年风雨路【转自cnBeta】
- Mastering InDesign CS3 for Print Design and Production
- 选择排序法
- Point-Based Graphics
- Learning SAS by Example: A Programmer's Guide
- Photoshop CS3 for Forensics Professionals: A Complete Digital Imaging Course for Investigators
- 无盘工作站系统软件构架指南
- Beginning Ubuntu Server Administration: From Novice to Professional
- asp.net连接数据库
- The Definitive Guide to JasperReports
- DAO模式