当前位置:网站首页>On the stability of common sorting
On the stability of common sorting
2022-07-23 08:29:00 【Harris-H】
About the stability of common sorting
1. Bubble sort
Obviously, for two adjacent and identical elements , Will not exchange relative positions , So it's stable .
2. Insertion sort
The arrangement is also based on the exchange of adjacent elements , So it's stable .
3. Selection sort

There may be options i i i When small elements , Destroy the relative position of the original same element .
4. Merge sort
When merging , Do not change the relative order , Because it's on the left + Right stitching .
5. Quick sort
Different cardinality , It may lead to different sorting results , The relativity of the same element is destroyed .
6. Heap sort
Heap sort is unstable , Because operations on the heap can change the relative order of equal items .
7. Shell Sort
The essence is grouping, inserting and sorting , The relative order within the group remains unchanged , The relative order between groups may have changed , So it's not stable .
8. Radix sorting
The stability of the , At first, the subscript will be used as the second keyword .
9. Bucket sort
The stability of the , Same as cardinality sorting .
10. Count sorting
The stability of the , Open the auxiliary array to record the number of occurrences of each number , Count sorting is not based on element comparison , Instead, it uses array subscripts to determine the correct position of the elements .
边栏推荐
- 跳转语句break 和continue
- Typescript对象扩展之对象原型__proto__与prototype
- Mria + RLOG 新架构下的 EMQX 5.0 如何实现 1 亿 MQTT 连接
- QgrapicsView实现画板
- 阿里云国际版忘记会员名或登录密码,怎么办?
- Redis中的数据类型
- Android安全专题-so逆向入门和使用ida动态调试
- 一文读懂Elephant Swap的LaaS方案的优势之处
- Shell variables, system predefined variables $home, $pwd, $shell, $user, custom variables, special variables $n, $, $*, [email protected],
- Keras深度学习实战(15)——从零开始实现YOLO目标检测
猜你喜欢

Bryntum Kanban task board 5.1.0 JS Kanban

Redis transaction and locking mechanism

"Weilai Cup" 2022 Niuke summer multi school training camp 1

编写代码,多个字符从两端移动,向中间汇聚

Program environment and pretreatment

Genesis公链:夯实Web 3.0发展底座

Go concurrent programming basics: what is context

DP+回溯分割回文串的系列问题

RedisTemplate Pipeline 管道使用

XMODEM, ymodem and zmodem protocols are the three most commonly used communication protocols
随机推荐
容器监控三剑客CAdvisor收集监控数据 + InfluxDB储存数据 + Granfana展示图表数据的简介
30行自己写并发工具类(Semaphore, CyclicBarrier, CountDownLatch)是什么体验?
园区/厂区怎么实现wifi上网短信认证
Shell变量、系统预定义变量$HOME、$PWD、$SHELL、$USER、自定义变量、特殊变量$n、$#、$*、[email protected]、$?、env看所有的全局变量值、set看所有变量
【arXiv2022】GroupTransNet: Group Transformer Network for RGB-D Salient Object Detection
网络参数管理
Flynk uses liststate to implement keyedstate
跳转语句break 和continue
Qgraicsview implementation palette
Object prototype of typescript object extension__ proto__ And prototype
Web3流量聚合平台Starfish OS,给玩家元宇宙新范式体验
第三章 栈
JS regular delete the span tag and the content in the tag
Get a control width
Dark horse programmer - interface testing - four-day learning interface testing - the second day - Interface use case design, test points, function testing, security testing, performance testing, sing
promise(一)
嵌入式系统移植【5】——交叉编译工具链
Use the same interface to realize different login methods
Typora set the title to automatically add sequence number
Android安全专题-so逆向入门和使用ida动态调试