+15 votes
2.4k views

Assume that the SLR parser for a grammar G has $n_1$ states and the LALR parser for G has $n_2$ states. The relationship between $n_1$ and $n_2$ is

1. $n_1$ is necessarily less than $n_2$
2. $n_1$ is necessarily equal to $n_2$
3. $n_1$ is necessarily greater than $n_2$
4. None of the above
asked | 2.4k views
0
please explain me why n1 is necessarily equal to n2 and why not n1 is necessarily less than n2.

## 3 Answers

+19 votes
Best answer
no of states in SLR and LALR are equal

and no of states in SLR and LALR are less than or equal to LR(1)
answered by Boss (32.1k points)
edited by
+2
0

Answer should be D. Right?

Because no of states in SLR and LALR are less than or equal to LR(1)

0
@Rishabh HEre comparision is asked for SLR(1) and LALR(1) in questions and no. in states in both these are equal.
+11 votes
no of states

CLR(1)>=LR(0)=SLR(1)=LALR(1)
answered by Active (2.8k points)
+5 votes
ans b)
answered by Loyal (5.3k points)
+1
I think it should be less than equal to?
0
So pls explain whether it is less than equals to or only equal?
Answer:

+37 votes
8 answers
1
+25 votes
2 answers
2
+28 votes
4 answers
3
+14 votes
8 answers
4
+21 votes
4 answers
5
+17 votes
3 answers
6
+24 votes
2 answers
7