並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 6 件 / 6件

新着順 人気順

RecursionSchemeの検索結果1 - 6 件 / 6件

  • 挿入ソートと選択ソートは双対 - Qiita

    先日 Gotanda.hs #1 @HERP というイベントがあって、そこでRecursion Schemesで考える並べ替えアルゴリズムというタイトルでA Duality of Sortsという論文の話をLTしたんですが、この記事ではそこで話せなかった論文の後半で解説されている挿入ソートと選択ソートの双対性について書いていきたいと思っています。 ソートアルゴリズムの復習 まずは主役の二人である挿入ソートと選択ソートについて見ていきましょう。 挿入ソートは与えられたリストの先頭から要素を取り出し、これまでに構築したソート済みのリストに挿入していくという処理を繰り返すことでソートを実現するアルゴリズムです。 出典: Insertion sort - Wikipedia これをHaskellで実装すると以下のようになります。 insertSort :: [Int] -> [Int] inser

      挿入ソートと選択ソートは双対 - Qiita
    • Recursion Schemeによるドドスコ問題の恐るべき解法 - Lambdaカクテル

      さる8月1日、計算機科学の根幹を揺るがすドドスコ問題が出題され、エンジニアたちは震撼した(意味: 面白問題が出たので、なるべくヘンテコな解法を使って己の技巧を誇示するためにエンジニアたちは競ってコードを書きはじめた)。 【問題】配列{"ドド","スコ"}からランダムに要素を標準出力し続け、『その並びが「ドドスコスコスコ」を3回繰り返したもの』に一致したときに「ラブ注入♡」と標準出力して終了するプログラムを作成せよ(配点:5点)— ((🐑++)) (@Sheeeeepla) 2022年8月1日 そこで、関数型テクニックをなんとかねじこんだ解法を作ったのでここに示す。 import higherkindness.droste.Coalgebra import higherkindness.droste.data.list.{ListF, ConsF, NilF} import higherk

        Recursion Schemeによるドドスコ問題の恐るべき解法 - Lambdaカクテル
      • An introduction to recursion schemes

        class: center, middle # An introduction to recursion schemes Nicolas Rinaudo • [@NicolasRinaudo] • [Besedo] --- class: center, middle # Recursive Data Types --- ## Linked list .center[![Linked List](img/list.svg)] --- ## Linked list .center[![Linked List - Cons](img/list-1.svg)] --- ## Linked list .center[![Linked List - Nil](img/list-nil.svg)] --- ## Linked list .center[![Linked List - Cons](img/

        • recursion-algorithms

          ██████╗ ███████╗ ██████╗██╗ ██╗██████╗ ███████╗██╗ ██████╗ ███╗ ██╗ ██╔══██╗██╔════╝██╔════╝██║ ██║██╔══██╗██╔════╝██║██╔═══██╗████╗ ██║ ██████╔╝█████╗ ██║ ██║ ██║██████╔╝███████╗██║██║ ██║██╔██╗ ██║ ██╔══██╗██╔══╝ ██║ ██║ ██║██╔══██╗╚════██║██║██║ ██║██║╚██╗██║ ██║ ██║███████╗╚██████╗╚██████╔╝██║ ██║███████║██║╚██████╔╝██║ ╚████║ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══

          • Unifying Structured Recursion Schemes

            Unifying Structured Recursion Schemes Ralf Hinze Nicolas Wu Jeremy Gibbons Department of Computer Science, University of Oxford, Wolfson Building, Parks Road, Oxford, OX1 3QD, England {ralf.hinze,nicolas.wu,jeremy.gibbons}@cs.ox.ac.uk Abstract Folds over inductive datatypes are well understood and widely used. In their plain form, they are quite restricted; but many dis- parate generalisations hav

            • Corecursion and anamorphisms | Whisper of the Heartman

              Thomas HeartmanFebruary 17, 2020 · mod: 20:58, March 15, 2020 You know that feeling where you hear about something and you immediately need to look into it? I had that while listening to the most recent episode of Adam Gordon Bell's /Corecursive/ podcast today, where they were talking about where the name of the podcast came from. Up until then I had just assumed that corecursive meant /mutually r

                Corecursion and anamorphisms | Whisper of the Heartman
              1