タグ

arrayとhash-functionに関するnabinnoのブックマーク (4)

  • Class: Hash (Ruby 2.1.3)

    A Hash is a dictionary-like collection of unique keys and their values. Also called associative arrays, they are similar to Arrays, but where an Array uses integers as its index, a Hash allows you to use any object type. Hashes enumerate their values in the order that the corresponding keys were inserted. A Hash can be easily created by using its implicit form: grades = { "Jane Doe" => 10, "Jim Do

  • 逆引きRuby – www.namaraii.com – Index of TAKEUCHI, Hitoshi

    逆引きRubyRubyを使ってやりたい事から、その方法を調べられる逆引きのリファレンスです。 逆引きRubyはもともとWikiで運用していました。このため、サイトのコンテンツは私以外の多くの方によって作成・編集されたものです。 2017年に静的HTML(jekyll)の管理へ移行しましたが、2018年10月からScrapboxへ移行しました。どなたでも編集いただけますので、ご協力いただける方はよろしくお願いします。 逆引きRuby (https://scrapbox.io/rubytips/逆引きRuby)

    nabinno
    nabinno 2014/09/24
    h.keys.at(rand h.keys.size) @=> random keys ; h.merge({cucumber:300}) #=> merged
  • Hash table - Wikipedia

    A small phone book as a hash table In computer science, a hash table is a data structure that implements an associative array, also called a dictionary or simply map; an associative array is an abstract data type that maps keys to values.[3] A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found.

    Hash table - Wikipedia
  • ハッシュ関数 - Wikipedia

    この記事は検証可能な参考文献や出典が全く示されていないか、不十分です。 出典を追加して記事の信頼性向上にご協力ください。(このテンプレートの使い方) 出典検索?: "ハッシュ関数" – ニュース · 書籍 · スカラー · CiNii · J-STAGE · NDL · dlib.jp · ジャパンサーチ · TWL (2018年6月) ハッシュ関数で名前と0から15までの整数をマッピングしている。"John Smith" と "Sandra Dee" のハッシュ値が衝突している。 ハッシュ関数 (ハッシュかんすう、英語: hash function) あるいは要約関数[1]とは、任意のデータから、別の(多くの場合は短い固定長の)値を得るための操作、または、その様な値を得るための関数のこと。ハッシュ関数から得られた値のことを要約値やハッシュ値または単にハッシュという。 ハッシュ関数は、主に

    ハッシュ関数 - Wikipedia
  • 1