Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
strings::suffix_array::ManberMyers Class Reference

#include <manber_myers.h>

List of all members.

Static Private Member Functions

template<typename _Iterator >
static void sortByFirstCharacter (_Iterator first, _Iterator last, int sigma, std::vector< int > *out)

Detailed Description

Constructs suffix array in O(n log n) time with Mamber-Myers algorithm.

The implementation is optimized to use as little memory as possible without great increase in code complexity, in this case it is 3N ints and 2N bools of storage. Note that authors of the paper claims it can be done in 2N ints, but I haven't been able to fully comprehend and write bug-free code for that version. Note: another implementation and some discussion can be found at http://forums.topcoder.com/?module=RevisionHistory&messageID=1171511


Member Function Documentation

template<typename _Iterator >
static void strings::suffix_array::ManberMyers::sortByFirstCharacter ( _Iterator  first,
_Iterator  last,
int  sigma,
std::vector< int > *  out 
) [inline, static, private]

Sort suffixes by first character. Note: This implementation is count-sort, because for reasonable small alphabets quicksort is awfully slow.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines