Skip to main content

Palindrome

Learn Palindrome (Strings, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Checking a Palindrome A palindrome reads the same forward and backward. The classic O(n) check uses two pointers starting at both ends, moving toward the middle - no need to build a reversed copy of the string.

More lessons in Strings