当前位置:网站首页>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-6111:螺旋矩阵 IV
- wordpress切换页面,域名变回了IP地址
- One question per day 1765 The highest point in the map
- [rust notes] 14 set (Part 1)
- js快速将json数据转换为url参数
- 开源存储这么香,为何我们还要坚持自研?
- Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
- Leetcode-22: bracket generation
- LeetCode 0108.将有序数组转换为二叉搜索树 - 数组中值为根,中值左右分别为左右子树
- 2022年贵州省职业院校技能大赛中职组网络安全赛项规程
猜你喜欢

QQ电脑版取消转义符输入表情

Appium自动化测试基础 — Appium测试环境搭建总结

6. Logistic model

MySQL advanced part 1: index
![Introduction to LVS [unfinished (semi-finished products)]](/img/72/d5a943a8d6d71823dcbd7f23dda35b.png)
Introduction to LVS [unfinished (semi-finished products)]

Appium automation test foundation - Summary of appium test environment construction

Sqlmap tutorial (1)

1.15 - input and output system

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

leetcode-6110:网格图中递增路径的数目
随机推荐
MySQL advanced part 2: the use of indexes
【Rust 笔记】16-输入与输出(上)
Redis publish subscribe command line implementation
884. Uncommon words in two sentences
Daily question 1688 Number of matches in the competition
1.14 - assembly line
Leetcode-6108: decrypt messages
WordPress switches the page, and the domain name changes back to the IP address
Leetcode-6111: spiral matrix IV
MySQL advanced part 2: SQL optimization
Leetcode backtracking method
LeetCode 0108.将有序数组转换为二叉搜索树 - 数组中值为根,中值左右分别为左右子树
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
2022年贵州省职业院校技能大赛中职组网络安全赛项规程
做 SQL 性能优化真是让人干瞪眼
Appium automation test foundation - Summary of appium test environment construction
[rust notes] 13 iterator (Part 2)
Quickly use Amazon memorydb and build your own redis memory database
Leetcode-6109: number of people who know secrets
QQ computer version cancels escape character input expression