Section Recognizing Strings Language Describes Recognition Algorithm Language L W W W Poss Q37130671

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.