Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string temp = "";
- int lenTemp = 0;
- int posS = 0;
- int key = 0;
- bool flagForIndex = true;
- false;
- bool flag = true;
- while (posS < s.length())
- {
- flag = true;
- int index = -1;
- flagForIndex = true;
- string tempStrInPrecBufMax = "";
- cout << tempStrInPrecBufMax;
- int len = -1;
- string secondTemp = "";
- while ((temp.find(tempStrInPrecBufMax) != std::string::npos || secondTemp.find(tempStrInPrecBufMax) != std::string::npos) && (posS < prevBufMax)) {
- tempStrInPrecBufMax += s[posS];
- posS++;
- len++;
- if (temp.length() > histBufMax)
- {
- string t = "";
- for (int i = temp.length() - histBufMax; i < temp.length(); i++)
- t += temp[i];
- temp = t;
- }
- if (temp.find(tempStrInPrecBufMax) != std::string::npos)
- {
- flagForIndex = false;
- index = temp.find(tempStrInPrecBufMax);
- }
- if (temp.find(tempStrInPrecBufMax) >= temp.length() - tempStrInPrecBufMax.length() && temp.find(tempStrInPrecBufMax) != std::string::npos) {
- if (flag){
- secondTemp = temp;
- flag = false;
- }
- secondTemp += s[key];
- key++;
- }
- else if (secondTemp.find(tempStrInPrecBufMax) != std::string::npos)
- {
- secondTemp += s[key];
- key++;
- }
- }
- if (index == -1)
- index = 0;
- else
- index = temp.length() - index;
- Node node(index, len, s[posS - 1]);
- res.push_back(node);
- key = posS;
- temp += tempStrInPrecBufMax;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement