<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Algorithm on bLueriVer</title><link>https://blueriverlhr.github.io/tags/algorithm/</link><description>Recent content in Algorithm on bLueriVer</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 15 May 2026 19:38:00 +0800</lastBuildDate><atom:link href="https://blueriverlhr.github.io/tags/algorithm/index.xml" rel="self" type="application/rss+xml"/><item><title>Algorithm</title><link>https://blueriverlhr.github.io/posts/algo/</link><pubDate>Fri, 15 May 2026 19:38:00 +0800</pubDate><guid>https://blueriverlhr.github.io/posts/algo/</guid><description>&lt;h2 id="stable-sort"&gt;Stable Sort&lt;/h2&gt;
&lt;p&gt;Definition: A sorting algorithm is said to be &lt;code&gt;stable&lt;/code&gt; if two objects with equal keys appear in the same order in sorted output as they appear in the input data set.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stable&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Stable by nature
&lt;ul&gt;
&lt;li&gt;Bubble Sort&lt;/li&gt;
&lt;li&gt;Insertion Sort&lt;/li&gt;
&lt;li&gt;Merge Sort&lt;/li&gt;
&lt;li&gt;Count Sort&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Non-comparison-based sorts
&lt;ul&gt;
&lt;li&gt;Counting Sort
&lt;ul&gt;
&lt;li&gt;the Sorted Array is filled in reverse order&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Sorts depend on another sort: the only requirement that the other sort should be stable
&lt;ul&gt;
&lt;li&gt;Radix Sort&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Unstable&lt;/strong&gt;:&lt;/p&gt;</description></item></channel></rss>