Push Down Automata program in java for Equal no of a’s and b’s

import java.io.*;
class Pda
{
static char st[]= new char[20];
static int ptr =0;

static void push(char e)
{
st[ptr]=e;
ptr++;
}

static void pop()
{
ptr–;
}

public static void main(String Args[])throws IOException
{
BufferedReader obj= new BufferedReader ( new InputStreamReader (System.in));
String ip;
System.out.println(“Enter String:”);
ip=obj.readLine();
int l;
boolean f=false;
int i;
for(i=0; i

Leave a Reply

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