edited by
2,098 views
1 votes
1 votes

Consider Grammar G with the following characteristic-

$A → ax$, where $A ∈ V$$a ∈ T$, $x ∈ V^*$, and any pair $( A, a )$ occurs at most once in $P$. For example, $S → aA \mid aB...,$ is not a grammar of type $G$ because the pair $(S,a)$ occur in two productions. Which of the following is proportional to the effort required to parse a string w belonging to $L(G)$ ?

  1. $\mid w \mid^3$
  2. $\mid w \mid$
  3. $2^{\mid w \mid}$
  4. Not a function of $\mid w \mid$ alone.
edited by

2 Answers

Best answer
1 votes
1 votes

Ans-B

As any (A,a) pair occurs only once... we can reduce any variable to terminal at each step. So parsing this type of grammar will require effort equal to length of string.

edited by

Related questions

1 votes
1 votes
1 answer
2
0 votes
0 votes
3 answers
3
Anmol Verma asked Nov 30, 2016
2,279 views
S->AbaCA->BCB->b/epsilonC->D/epsilonD->d I want to know that will A contain epsilon as B and C both are null variables???(In Elimination of epsilon-production)