Accessing the first Character of a String with no Characters
问题 I am implementing a suffix trie in C++. The implementation of the Trie contructor can be seen below. #include <iostream> #include <cstring> #include "Trie.hpp" using namespace std; Trie::Trie(string T){ T += "#"; //terminating character this->T = T; nodes.reserve(T.length() * (T.length() + 1) / 2); //The number of nodes is bounded above by n(n+1)/2. The reserve prevents reallocation (http://stackoverflow.com/questions/41557421/vectors-and-pointers/41557463) vector<string> suffix; //vector of