by Quelloquialism » Sun May 06, 2007 3:11 pm
Nah, Floyd-Warshall is for solving the all-pairs shortest paths problem (given a weighted, connected, directed graph with no negative cycles, find the shortest distance between any pair of vertices)...calfflac doesn't require any standard algorithm that I know of, it's all ad-hoc. My passing solution involved a linear search that simply looped through the text, counting the current index as either the center of an odd-length palindrome or the first center of an even-length palindrome...that'll work for you, probably, if you keep your code relatively clean and you opt for a character array instead of costly String operations.