You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
mk-mode.com Linux, Debian, IT, Server, PG, Ruby, Rails, Python, C++, Fortran, PC, MariaDB, math, GIS, etc... 先日、「標準(筆算)法」による多桁同士の乗算アルゴリズムを C++ に実装してみました。 C++ - 多桁乗算(標準(筆算)法)! 今回は、「標準(筆算)法」より高速に乗算が可能な「Karatsuba 法」アルゴリズムを C++ で実装してみました。 0. 前提条件 Linux Mint 14 Nadia (64bit) での作業を想定。 g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 また、当方の環境で扱える int 型の範囲は以下のとおり。 int : -2,147,483,648 〜 2,147,483,647 1. Karatsuba
This article introduces a template class-based approach to construct and query Patricia tries. The article includes source code and a demo application. Download source files - 11.8 Kb Download demo project - 13.9 Kb Introduction While working for a company that produced software development tools, I had to write an application that encapsulated an entire file system within a single file. Part of t
Suffix Array (Larsson-Sadakane) 説明 Suffix Arrayとは,与えられた文字列の接尾辞の集合を辞書順ソートしたものである.近年,これを用いることによって多くの文字列の問題が解かれることがわかってきた. Larsson-Sadakane は Suffix Array を O(n (log n)^2) 時間で構成するアルゴリズムである.Mamber-Myers と同様のアイデアによって文字列長を倍加させ,O(log n) 回の multikey quicksort を行うことにより,全体で O(n (log n)^2) の計算量を達成する.詳しくは適当な文献を参照. Suffix Array を用いて解けるもっとも典型的な問題は,文字列の検索である.Suffix Array 上で二分探索を行えば,O(m log n) でパターンの検索ができる.また,Suf
Group description The research group studies a new subfield of data compression - data structure compression. The new aspect compared to traditional compression is that the compressed data (structure) needs to be represented so that access to its internal parts is provided without uncompressing the whole structure. As an example, consider a binary tree of n nodes. It is possible to represent the t
SuDS project / Compressed suffix tree implementation News Our C++-implementation of compressed suffix tree is available for download (version 1.1). Note: If you have access to a 64-bit server machine with 32 GB memory, you can construct the compressed suffix tree of the complete Human Genome. The final memory requirement for HG is 8.8 GB, but during construction the memory peak is at 24 GB. This v
Competitive Programming Advent Calendar Div2013の12月2日の分です。 ときどき脱線しながらも主にsegment treeの再帰展開について書こうと思います。 はじめに segment treeの資料といえば蟻本やiwiさんのスライドが非常に分かりやすくお勧めです(定番中の定番ですね)。この資料で使われている図をイメージしながら読んでください。同じくiwiさんの平衡二分探索木のスライドもぜひ目を通しておきましょう。 これら以外にもsegment treeについてまとめたブログ記事などは検索すれば色々引っかかります。去年や今年のAdvent Calendarでも初学者向けの記事があるようです。初学者向けの詳しい解説はそちらをご覧ください。 私なりにsegment treeの動作原理を短くまとめると、「区間をたかだかO(log n)個の交わらない区
大学院の授業で最小スパニング木をやって、その実装方法の途中でやったUnion Findを忘れないうちに実装。 美しいアルゴリズムを見ると本当にSUGEEEEEEEEEってなるよね。 #include <iostream> #include <vector> class UnionFind{ private: std::vector<int> data_array; const int root(int id){ if(data_array[id] >= 0) return data_array[id] = root(data_array[id]); else return id; } public: UnionFind(size_t size) : data_array(size,-1){} // unionは予約語 bool union_(int lhs, int rhs){ lhs =
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く