<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inarizuuuushi</author_name>
  <author_url>https://blog.hatena.ne.jp/inarizuuuushi/</author_url>
  <blog_title>Sabrou-mal サブロウ丸</blog_title>
  <blog_url>https://inarizuuuushi.hatenablog.com/</blog_url>
  <categories>
    <anon> python </anon>
    <anon>アルゴリズム周辺</anon>
  </categories>
  <description>今更感ありますが、、二分木構造に関するDFSで、1. 行きがけ、2. 帰りがけ, 3. 全記録、のPythonコードを紹介します。本稿では下記の木を例に使用します。 幅優先探索（BFS）はオレンジ色の順番のように、深さが浅いノードを優先して探索を行います。 ここでは走査した順でノード（頂点）番号を記録することが要求されているとします。基本的にはqueue（first in, first out)データ構造を用いて実装します。 配列で二分木情報が与えられている場合 幅優先探索 最良優先探索 Nodeクラスで情報が与えられている場合 幅優先探索 最良優先探索 関連 配列で二分木情報が与えられている…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finarizuuuushi.hatenablog.com%2Fentry%2F2022%2F10%2F31%2F090000&quot; title=&quot;(BFS) 幅優先探索; python - Sabrou-mal サブロウ丸&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>https://cdn-ak.f.st-hatena.com/images/fotolife/i/inarizuuuushi/20220904/20220904210200.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-10-31 09:00:00</published>
  <title>(BFS) 幅優先探索; python</title>
  <type>rich</type>
  <url>https://inarizuuuushi.hatenablog.com/entry/2022/10/31/090000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
