当前位置:网站首页>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)
边栏推荐
- LeetCode 0108. Convert an ordered array into a binary search tree - the median of the array is the root, and the left and right of the median are the left and right subtrees respectively
- The difference between CPU core and logical processor
- Redis publish subscribe command line implementation
- 多屏电脑截屏会把多屏连着截下来,而不是只截当前屏
- [practical skills] how to do a good job in technical training?
- MySQL advanced part 1: View
- WordPress switches the page, and the domain name changes back to the IP address
- The sum of the unique elements of the daily question
- RGB LED infinite mirror controlled by Arduino
- 1040 Longest Symmetric String
猜你喜欢

Liunx starts redis

Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition

SPI details

数据可视化图表总结(二)

Smart construction site "hydropower energy consumption online monitoring system"

Overview of variable resistors - structure, operation and different applications

6. Logistic model

Some common problems in the assessment of network engineers: WLAN, BGP, switch
![Introduction to LVS [unfinished (semi-finished products)]](/img/72/d5a943a8d6d71823dcbd7f23dda35b.png)
Introduction to LVS [unfinished (semi-finished products)]

MySQL advanced part 2: optimizing SQL steps
随机推荐
Leetcode-31: next spread
1039 Course List for Student
Redis publish subscribe command line implementation
Dynamic planning solution ideas and summary (30000 words)
2022年貴州省職業院校技能大賽中職組網絡安全賽項規程
MySQL advanced part 1: stored procedures and functions
927. 三等分 模拟
Regulations for network security events of vocational group in 2022 Guizhou Vocational College skill competition
A reason that is easy to be ignored when the printer is offline
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
MySQL advanced part 2: SQL optimization
MIT-6874-Deep Learning in the Life Sciences Week 7
js快速将json数据转换为url参数
Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
One question per day 1020 Number of enclaves
Leetcode-6110: number of incremental paths in the grid graph
Collection: programming related websites and books
MIT-6874-Deep Learning in the Life Sciences Week 7
LeetCode 0107. Sequence traversal of binary tree II - another method
One question per day 1447 Simplest fraction