## //[[Rcpp::depends(triebeard)]] ## #include ## radix_tree radix; ## radix_tree radix; ## radix["turnin"] = "entry the first"; ## radix["turin"] = "entry the second"; ## ## radix_tree::iterator it; ## ## it = radix.longest_match("turing"); ## ## if(it = radix.end()){ ## printf("No match was found :("); ## } else { ## std::string result = "Key of longest match: " + it->first + " , value of longest match: " + it->second; ## } ## radix_tree radix; ## radix["turnin"] = "entry the first"; ## radix["turin"] = "entry the second"; ## ## std::vector::iterator> vec; ## std::vector::iterator>::iterator it; ## ## it = radix.prefix_match("tur"); ## ## if(it == vec.end()){ ## printf("No match was found :("); ## } else { ## for (it = vec.begin(); it != vec.end(); ++it) { ## std::string result = "Key of a prefix match: " + it->first + " , value of a prefix match: " + it->second; ## } ## }