c语言按英语的成绩排序,C语言常用排序方法大全(国外英语资料).doc

C语言常用排序方法大全(国外英语资料)

C语言常用排序方法大全(国外英语资料)

C language commonly used sorting method Daquan

*

=============================================================================

Related knowledge (all definitions are intended only to help readers understand relevant concepts, not strictly defined):

1, stable sorting and unstable sorting

Simply put, all equal numbers can still keep their relative order before they are sorted by some sort of sorting method

This sort of sorting method is stable. On the other hand, it is unstable.

For example: a set of numbers sorted before A1, A2, A3, A4, A5,, where a2=a4, after some sort of A1, A2, A4, A3, a5,

We say that this sort of ordering is stable, because the A2 is sorted before A4, and after sorting, it is still in front of a4. If it becomes A1, a4,

A2, A3, A5 aren't stable anymore.

2, internal sorting and external sorting

In the sorting process, all the numbers that need to be sorted are in memory, and their storage order is adjusted in memory, called intra sorting;

In the sorting process, only part of the number is transferred to memory, and the memory adjustment in the file memory storing order sorting method called external sorting.

3, the time complexity and space complexity of the algorithm

The time complexity of the algorithm refers to the amount of computation required to perform the algorithm.

The spatial complexity of an algorithm, in general, refers to the memory space needed to perform this algorithm.

================================================================================

* /

*

================================================

Function: select sort

Input: the name of the array (that is, the initial address of the array) and the number of elements in the array

================================================

* /

*

====================================================

The algorithm idea is described simply:

In a set of numbers to be sorted, the minimum number is chosen to be exchanged with the first position;

Then, in the remaining number,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值