Horje
String | Palindrome

What is a Palindrome String?

A string is called a palindrome if the reverse of the string is the same as the original one.

Example: “madam”, “racecar”, “12321”.

Palindrome String

Properties of a Palindrome:

A palindrome string has some properties which are mentioned below:

  • A palindrome string has a symmetric structure which means that the character in the first half of the string are the same as in the rear half but in reverse order.
  • Any string of length 1 is always a palindrome.

How to identify a Palindrome?

We can follow the below steps to identify a palindrome:

  • Depending on the case sensitivity, either turn all the characters to lowercase or uppercase or keep them as it is.
  • Now, Compare the first and the last character. If they are the same move to the second and second last and so on.
  • If all the pairs of characters match, then it is a palindrome, otherwise not.

Easy Problems on Palindrome:

Medium Problems on Palindrome:

Hard Problems on Palindrome:

Quick Links:




Reffered: https://www.geeksforgeeks.org


DSA

Related
String in Data Structure String in Data Structure
Minimize the size of the string formed by performing following operation Minimize the size of the string formed by performing following operation
What should I learn first, C++ STL or DSA? What should I learn first, C++ STL or DSA?
Graph Data Structure And Algorithms Graph Data Structure And Algorithms
Square submatrices with odd boundary sum Square submatrices with odd boundary sum

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
16