You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checking the isPalindrome... The classic algorithms are expressed as an "character-by-character algorithm", and is fine. Is oriented to a low-level view of algoritms and data-structures.
Another classic manner to view pattern-recognition algoritms in strings, is to express it by regular expression
isPalindrome() by "anchored recursive" regular expression ^((.)(?:(?1)|.?)\2)$
containsPalindrone() by recursive regular expression, supposing only letters (\w)(?:(?R)|\w?)\1
It is a good view from a first abstraction layer of strings... And is also classic.
The best layer for an algorithm perhaps is where the simplest and faster algorithm is expressed. It is also "classic". In the isPalindrome() an intermediary layer of abstraction, the ideal to express the same algorithm, is by use the string.reverse() method to compare strings.
The text was updated successfully, but these errors were encountered:
Checking the isPalindrome... The classic algorithms are expressed as an "character-by-character algorithm", and is fine. Is oriented to a low-level view of algoritms and data-structures.
Another classic manner to view pattern-recognition algoritms in strings, is to express it by regular expression
isPalindrome()
by "anchored recursive" regular expression^((.)(?:(?1)|.?)\2)$
containsPalindrone()
by recursive regular expression, supposing only letters(\w)(?:(?R)|\w?)\1
It is a good view from a first abstraction layer of strings... And is also classic.
The best layer for an algorithm perhaps is where the simplest and faster algorithm is expressed. It is also "classic". In the
isPalindrome()
an intermediary layer of abstraction, the ideal to express the same algorithm, is by use thestring.reverse()
method to compare strings.The text was updated successfully, but these errors were encountered: