タグ

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

  • 関連タグはありません

タグの絞り込みを解除

algorithmとc++に関するyasuharu519のブックマーク (2)

  • Open Data Structures

    Open Data Structures covers the implementation and analysis of data structures for sequences (lists), queues, priority queues, unordered dictionaries, ordered dictionaries, and graphs. Data structures presented in the book include stacks, queues, deques, and lists implemented as arrays and linked-lists; space-efficient implementations of lists; skip lists; hash tables and hash codes; binary search

  • std::string::findより速くなるかもしれない。boost::algorithmのboyer_moore_searchとかknuth_morris_pratt_searchとか - Qiita

    この記事は、C++ Advent Calendar 2014の2014年12月7日ぶんです。(1時間弱遅刻してしまいました) これは何ですか C++標準の文字列クラスstd::stringには、その中に指定されたキーワード(文字列)が含まれているか&含まれている場合には何文字目から出現するかを返すメソッドとして、std::string::findが用意されている。 多くの場合これがあれば事足りるのだが、あまり長い文字列を検索キーワードに指定するような場合には、(少なくとも理論的には)大幅に遅くなることが知られている。 これを改善した(少なくとも理論的には)アルゴリズムとして、Boyer-Moore SearchやKnuth-Morris-Pratt Searchというアルゴリズムがある。記事では上記の遅くなる理由とこれら二つのアルゴリズムについて概略を説明する(実装の詳細は一部のみ説明)

    std::string::findより速くなるかもしれない。boost::algorithmのboyer_moore_searchとかknuth_morris_pratt_searchとか - Qiita
  • 1