The section “Recognizing Strings in a Language” describes arecognition algorithm for the language
L = {w$w’ : w is a possibly empty string of characters otherthan $, w’=reversc(w)}
Use reference-based Queue in Java, to implement thisalgorithm on a string recognizer:
import Interfaces.StringRecognizerInterface;
public class StringRecognizer implementsStringRecognizerInterface {
public boolean recognizeString(String s) {
/*
* s = input string fortesting
* This method should return true ifs is in the language L = {w$w | w is a an empty string or a stringof characters other than $}
* otherwise return false.
*/
return false;
}
}
—————————————————————
package Interfaces;
public interface StringRecognizerInterface
OR
OR