Java Program to Construct Turing Machine for Well Formedness of Parenthesis

import java.io.*;
class tm
{
public static void main(String args[])throws IOException
{
BufferedReader o=new BufferedReader(new InputStreamReader(System.in));
char a[]=new char[15];
int i,j,flag=1;
System.out.println(“Enter String: “);
String str=o.readLine();
for(i=0;i=0;j–)
{
if (a[j]=='(‘)
{
a[i]=’*’;
a[j]=’*’;
break;
}
}
}

}
for(i=0;i

Leave a Reply

Your email address will not be published. Required fields are marked *