Question: please explain and draw stack too thanks Input 0,1 in array S While S is not empty Take 1 word from left , output it
Input 0,1 in array S While S is not empty Take 1 word from left , output it in c Delete the word from array S and set again to S If c='0' Then push it to stack Else if stack is not empty then pop '0' from stack else reject Accept S A.)If input is 001001110, is it rejected or not? B.)If input S, number of '0' is greater than number of '1', can we say that it is always rejected? C.)lf input S, number of '1' is greater than number of '0', can we say that it is always rejected? Input 0,1 in array S While S is not empty Take 1 word from left , output it in c Delete the word from array S and set again to S If c='0' Then push it to stack Else if stack is not empty then pop '0' from stack else reject Accept S A.)If input is 001001110, is it rejected or not? B.)If input S, number of '0' is greater than number of '1', can we say that it is always rejected? C.)lf input S, number of '1' is greater than number of '0', can we say that it is always rejected
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
