-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpalindrome.h
More file actions
25 lines (21 loc) · 731 Bytes
/
palindrome.h
File metadata and controls
25 lines (21 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef CPP_ALGORITHM_PALINDROME_H
#define CPP_ALGORITHM_PALINDROME_H
#include <string>
namespace Palindrome
{
/**
* \brief Check if a string is palindromic.
* Use one pointer to iterate half of the string.
* \param str input string
* \return true if the string is palindromic, false otherwise
*/
auto IsPalindromic1(const std::string& str) -> bool;
/**
* \brief Check if a string is palindromic.
* Use two pointers to iterate the string. One pointer starts from the beginning, the other starts from the end.
* \param str input string
* \return true if the string is palindromic, false otherwise
*/
auto IsPalindromic2(const std::string& str) -> bool;
}
#endif