https://github.com/simongog/sdsl-lite
Tip revision: 6ac2394b4234cbe797092e0ff7563ec70c97dbed authored by Simon Gog on 26 September 2013, 12:23:37 UTC
Merge pull request #116 from xosh/feature_wt
Merge pull request #116 from xosh/feature_wt
Tip revision: 6ac2394
cst-bfs-iterator.cpp
#include <sdsl/suffix_trees.hpp>
#include <iostream>
#include <string>
using namespace std;
using namespace sdsl;
typedef cst_sct3<> cst_t;
int main(int argc, char* argv[])
{
if (argc < 2) {
cout << "usage: "<<argv[0]<< " file" << std::endl;
return 1;
}
cst_t cst;
construct(cst, argv[1], 1);
typedef cst_bfs_iterator<cst_t> iterator;
iterator begin = iterator(&cst, cst.root());
iterator end = iterator(&cst, cst.root(), true, true);
for (iterator it = begin; it != end; ++it) {
std::cout << cst.depth(*it) << "-[" << cst.lb(*it) << "," << cst.rb(*it) << "]" << std::endl;
}
}