December2015 cs Q28

0. Given the following two languages: L1 = {anban|n > 0} L2 = {an b an bn + 1|n > 0} Which of the following is correct ?

  • Option : A
  • Explanation : Language L1 is context free language as L1 = {anban|n > 0}, we can compare number of a’s before b and number of a’s after b both are equal using only one stack using push and pop function but we can not compare language L2. L2 = {an b an bn + 1|n > 0} using only one stack here we can compare all number of a’s before b and number of a’s after b both are equal using only one stack using push and pop function but we cannot compare all bn + 1 at that time. Hence, L1 is context free language and L2 is not context free language.
Cancel reply

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


Cancel reply

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