当前位置:网站首页>Simple selection sort of selection sort
Simple selection sort of selection sort
2022-07-05 06:16:00 【Beauty of algorithm and programming】
1. introduction
As soon as I hear the words of selective sorting, my first reaction is to sort through selection , So is our first reaction right , Let's verify , Understand its definition . Simple selection sort : The simplest selection method is to scan the elements in the sequence sequentially , Remember the smallest element encountered ( At the end of a scan, the smallest element is found . Repeated scanning can complete the sorting work ). Obviously, that's what we understand , Each time, select the smallest element of the sequence and sort it in turn .
2. problem
Given a sequence , How do we sort it by simple selection sorting , The following will be described one by one .
Example 1:27,54,18,36,78,48
Output :18,27,36,48,54,78
3. Algorithm description
Example 1 It's an out of order sequence , What we need to do is to arrange the disordered sequence into a sequence from small to large . This problem is realized by simple selection sorting , According to the definition of simple sorting , The first is to find the smallest in the sequence , Then find the second smallest ( That is, in addition to the last found element , Find the smallest... From the remaining elements ), Repeat the search until the sorting is complete , This process is illustrated below .
4. Conclusion
The method is a simple exchange using a direct selection sorting algorithm , That is, the above position of exchanging two elements . This is my understanding of simple selection sorting , There may be a better understanding , I will continue to study .
Internship editor : Heng Hui
Source of contribution : Deep learning and cultural tourism application laboratory (DLETA)
边栏推荐
- liunx启动redis
- Currently clicked button and current mouse coordinates in QT judgment interface
- Daily question 1984 Minimum difference in student scores
- 7. Processing the input of multidimensional features
- [rust notes] 13 iterator (Part 2)
- 1.14 - assembly line
- 数据可视化图表总结(一)
- Leetcode-6108: decrypt messages
- Introduction to LVS [unfinished (semi-finished products)]
- 1041 Be Unique
猜你喜欢
Dynamic planning solution ideas and summary (30000 words)
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
做 SQL 性能优化真是让人干瞪眼
Full Permutation Code (recursive writing)
Groupbykey() and reducebykey() and combinebykey() in spark
Smart construction site "hydropower energy consumption online monitoring system"
RGB LED infinite mirror controlled by Arduino
7. Processing the input of multidimensional features
LeetCode 0107. Sequence traversal of binary tree II - another method
Sqlmap tutorial (1)
随机推荐
One question per day 1765 The highest point in the map
2022年贵州省职业院校技能大赛中职组网络安全赛项规程
leetcode-6108:解密消息
R language [import and export of dataset]
In depth analysis of for (VaR I = 0; I < 5; i++) {settimeout (() => console.log (I), 1000)}
[rust notes] 14 set (Part 1)
On the characteristics of technology entrepreneurs from Dijkstra's Turing Award speech
Data visualization chart summary (I)
927. Trisection simulation
884. Uncommon words in two sentences
【Rust 笔记】16-输入与输出(上)
leetcode-6110:网格图中递增路径的数目
传统数据库逐渐“难适应”,云原生数据库脱颖而出
Leetcode-6109: number of people who know secrets
Leetcode-556: the next larger element III
Shutter web hardware keyboard monitoring
Appium自动化测试基础 — Appium测试环境搭建总结
2022 pole technology communication arm virtual hardware accelerates the development of Internet of things software
阿里巴巴成立企业数智服务公司“瓴羊”,聚焦企业数字化增长
Sqlmap tutorial (II) practical skills I