当前位置:网站首页>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)
边栏推荐
- Matrixdb V4.5.0 was launched with a new mars2 storage engine!
- 1041 Be Unique
- Currently clicked button and current mouse coordinates in QT judgment interface
- MySQL advanced part 2: storage engine
- Redis publish subscribe command line implementation
- Flutter Web 硬件键盘监听
- 2022年貴州省職業院校技能大賽中職組網絡安全賽項規程
- LeetCode 0107.二叉树的层序遍历II - 另一种方法
- MySQL advanced part 1: index
- 【Rust 笔记】14-集合(下)
猜你喜欢
QQ computer version cancels escape character input expression
Dynamic planning solution ideas and summary (30000 words)
Open source storage is so popular, why do we insist on self-development?
Real time clock (RTC)
MySQL advanced part 1: index
6. Logistic model
LeetCode 0108.将有序数组转换为二叉搜索树 - 数组中值为根,中值左右分别为左右子树
Network security skills competition in Secondary Vocational Schools -- a tutorial article on middleware penetration testing in Guangxi regional competition
Introduction to LVS [unfinished (semi-finished products)]
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
随机推荐
2022年贵州省职业院校技能大赛中职组网络安全赛项规程
leetcode-1200:最小绝对差
SQLMAP使用教程(一)
LVS简介【暂未完成(半成品)】
In depth analysis of for (VaR I = 0; I < 5; i++) {settimeout (() => console.log (I), 1000)}
Leetcode-556: the next larger element III
New title of module a of "PanYun Cup" secondary vocational network security skills competition
1040 Longest Symmetric String
How to adjust bugs in general projects ----- take you through the whole process by hand
Redis publish subscribe command line implementation
MySQL advanced part 2: MySQL architecture
打印机脱机时一种容易被忽略的原因
MySQL advanced part 1: index
【Rust 笔记】15-字符串与文本(下)
1.13 - RISC/CISC
Daily question 2006 Number of pairs whose absolute value of difference is k
leetcode-9:回文数
2022年貴州省職業院校技能大賽中職組網絡安全賽項規程
Binary search template
MySQL advanced part 1: triggers