<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sirocco</author_name>
  <author_url>https://blog.hatena.ne.jp/sirocco/</author_url>
  <blog_title>sirocco の書いてもすぐに忘れるメモ</blog_title>
  <blog_url>https://sirocco.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Algorithm</anon>
  </categories>
  <description>常に子よりも親が大きい（小さい）値の二分木をヒープという。 今度はヒープを使ったソート、ヒープソートをやってみます。 def heap(array,n) if n &gt; 0 parent = (n - 1) / 2 # 親の位置 if array[n] &gt; array[parent] tmp = array[n] array[n] = array[parent] array[parent] = tmp end heap(array,parent) end end def out(array,sorted) (array.size-1).downto(1) do |n| heap(array,n)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsirocco.hatenadiary.org%2Fentry%2F20100103%2F1262509599&quot; title=&quot;ヒープソートをやってみる。 - sirocco の書いてもすぐに忘れるメモ&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>2010-01-03 18:06:39</published>
  <title>ヒープソートをやってみる。</title>
  <type>rich</type>
  <url>https://sirocco.hatenadiary.org/entry/20100103/1262509599</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
