<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zehnpaard</author_name>
  <author_url>https://blog.hatena.ne.jp/zehnpaard/</author_url>
  <blog_title>Arantium Maestum</blog_title>
  <blog_url>https://zehnpaard.hatenablog.com/</blog_url>
  <categories>
    <anon>Clojure</anon>
    <anon>アルゴリズム</anon>
  </categories>
  <description>そういえばClojureのsequenceはvectorじゃない場合は大抵countがO(n)だった。 bubble-sortでO(n)回bubbleを呼び、bubble内でO(n)回再帰して、その中でO(1)の作業だったはずが、(cond (&gt;= i (count xs)))でもう一回O(n)の作業を入れていたのでO(n3)になる。 解決策として、countはbubble内で一回だけ呼んでその後再帰するたびにdecしていく。 (defn bubble [xs i] (loop [left [] x1 (first xs) [x2 &amp; right :as xs] (rest xs) j (co…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2016%2F05%2F08%2F074214&quot; title=&quot;Clojureでバブルソート２ - Arantium Maestum&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>2016-05-08 07:42:14</published>
  <title>Clojureでバブルソート２</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2016/05/08/074214</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
