<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tomoemon</author_name>
  <author_url>https://blog.hatena.ne.jp/tomoemon/</author_url>
  <blog_title>tomoemonの日記</blog_title>
  <blog_url>https://tomoemon.hateblo.jp/</blog_url>
  <categories>
    <anon>アルゴリズム</anon>
  </categories>
  <description>PHPのソート関数は不安定です。なんで安定ソートの一つや二つ初めから用意してくれないんだよ！と言いたいところですがPHPなので諦めます。ちなみにPythonは2.3から安定ソートであることが保証されています*1。 さて、安定なソートであれば問題無いのに、そうでないと困るのは次のような場合です。 $a = array( array(&quot;id&quot;=&gt;2, &quot;name&quot;=&gt;&quot;A&quot;), array(&quot;id&quot;=&gt;1, &quot;name&quot;=&gt;&quot;C&quot;), array(&quot;id&quot;=&gt;3, &quot;name&quot;=&gt;&quot;A&quot;) ); まず、この$aをidでソートすると下のようになります。 id=1, name=C id=2, name…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftomoemon.hateblo.jp%2Fentry%2F20091201%2Fp1&quot; title=&quot;不安定なマージソート - tomoemonの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-12-01 00:00:00</published>
  <title>不安定なマージソート</title>
  <type>rich</type>
  <url>https://tomoemon.hateblo.jp/entry/20091201/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
