The Gateway to Computer Science Excellence
0 votes
123 views

How to understand such problems?

in Theory of Computation by Active (3.1k points) | 123 views
0

For this problem, check how many comparisons you need to do.

L1: Number of 0 in the beginning should be equal to sum of the number of 1 & 0 thereafter. Only one comparison needed which can be solved using single stack. So, CFL.

L2: Number of 0 in the beginning should be equal to  number of 1 thereafter & number of 0 should be less than both of them. Two comparisons needed which can be solved using two stacks. So, CSL.

L3: Number of 0 in the beginning should be equal to  number of 1 & number of 0 thereafter. Two comparisons needed which can be solved using two stacks. So, CSL.

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,666 questions
56,159 answers
193,768 comments
93,766 users