<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>program-shoshinsya</author_name>
  <author_url>https://blog.hatena.ne.jp/program-shoshinsya/</author_url>
  <blog_title>auの日記</blog_title>
  <blog_url>https://program-shoshinsya.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>auです。配列の先頭を取得して、その値は削除する処理が欲しくなりました。値を取得して削除するとなると、「pop」が1番に思いつきました。しかし、Pythonの場合は一番後ろの値を選択することになります。先頭を取得するとなると、「pop(0)」とする必要がありますが、これは計算量的には正しくないようです。理由は、先頭の値を取り出した後、他の値を一つずつずらす操作がされているからだそうです。配列の長さは10以下になるようにしているので問題がないのですが、もし1万とかになった場合の正しい処理が知りたいです。一度取り出してからスライスをして削除とかしてもいいと思うのですが、1行で済むし、「pop」がさ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fprogram-shoshinsya.hatenablog.com%2Fentry%2F2020%2F09%2F18%2F211712&quot; title=&quot;Pythonの配列の先頭を取得するのって「pop」でいいの？ - auの日記&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>2020-09-18 21:17:12</published>
  <title>Pythonの配列の先頭を取得するのって「pop」でいいの？</title>
  <type>rich</type>
  <url>https://program-shoshinsya.hatenablog.com/entry/2020/09/18/211712</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
