<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>snishimura0926</author_name>
  <author_url>https://blog.hatena.ne.jp/snishimura0926/</author_url>
  <blog_title>2:00am, Writing code</blog_title>
  <blog_url>https://2amcode.hatenablog.com/</blog_url>
  <categories>
    <anon>Javascript</anon>
    <anon>Algorithms &amp; Data structures</anon>
  </categories>
  <description>前回の記事はこちら。 今回は前回から引き続きスタックの活用方法を見ていく。スタックの活用方法の例題としてよく挙げられるのが「逆ポーランド記法の数式を計算する」という課題である1。ということで実際にJavascriptでスタックを使って上記の処理を実装してみる。 ここでは入力は「逆ポーランド記法で記述された半角スペース区切りの数字及び演算子の文字列1行」を想定する。なお以下のコードのStackは前回作成したものを使用する。 function solveRpn(input) { const inputs = input.split(' '); const s = new Stack(); cons…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2F2amcode.hatenablog.com%2Fentry%2F2017%2F08%2F26%2F000000&quot; title=&quot;スタックで逆ポーランド記法の数式を計算する - 2:00am, Writing code&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://images-fe.ssl-images-amazon.com/images/I/51oWwpzibRL._SL160_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-08-26 00:00:00</published>
  <title>スタックで逆ポーランド記法の数式を計算する</title>
  <type>rich</type>
  <url>https://2amcode.hatenablog.com/entry/2017/08/26/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
