関連タグで絞り込む (1)

タグの絞り込みを解除

algorithmとprogrammingに関するenerickのブックマーク (2)

  • Sorting Algorithms Demo

    Sorting Algorithms We all know that Quicksort is one of the fastest algorithms for sorting. It's not often, however, that we get a chance to see exactly how fast Quicksort really is. The following applets chart the progress of several common sorting algorithms while sorting an array of data using in-place algorithms. This means that the algorithms do not allocate additional storage to hold tempora

    enerick
    enerick 2011/06/06
    Chrome11(mac)だとブロック解除しても上手く表示できなかったからFirefox4で見た
  • 二分木を使った数式の逆ポーランド記法化と計算 - smdn.jp

    一般に人が読むことを前提にした数式はx = 1 - 2 + 3の様な形式で表記されますが、演算の順序などを考えるとコンピュータにとってはこの表記は扱いにくいものです。 コンピュータとしてはこの式はx 1 2 - 3 + =と表記されていたほうが扱いやすくなります。 このような形式での表記が逆ポーランド記法です。 逆ポーランド記法で記述された数式x 1 2 - 3 + =は、「xに1から2を引いた(-)ものに3を足して(+)代入する(=)」と読むことができます。 より機械的な表現にすれば「xに、1に2を-して、それに3を+して、それを=する」と読むこともできます。 つまり、この表記においては、演算対象と演算処理が処理順に記述されることになります。 プログラミングなどではx = 1 - 2 + 3;といった式を書きますが、実は実行時にはスタックというものを使って逆ポーランド記法的に計算していま

    二分木を使った数式の逆ポーランド記法化と計算 - smdn.jp
  • 1