Skip to content

Commit

Permalink
修复可能越界的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
soulmachine committed May 26, 2014
1 parent ebb384b commit 86ecfee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions C++/chapDFS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ \subsubsection{深搜1}
}

bool isPalindrome(const string &s, int start, int end) {
while (s[start] == s[end]) {
while (start < end && s[start] == s[end]) {
++start;
--end;
}
Expand Down Expand Up @@ -101,7 +101,7 @@ \subsubsection{深搜2}
}
}
bool isPalindrome(const string &s, int start, int end) {
while (s[start] == s[end]) {
while (start < end && s[start] == s[end]) {
++start;
--end;
}
Expand Down

0 comments on commit 86ecfee

Please sign in to comment.