Online GK Series

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Postal Assistants, Bank, GATE and NET

Q.

What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e., of type A -> ε and A -> a) to parse a string with n tokens?

A n/2
B n-1
C 2n-1
D 2n

Answer & Explanation

Answer: Option [C]

(2n-1) is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e., of type A -> ε and A -> a) to parse a string with n tokens.

Your Valuable Comments Please...

Useful Computer Science EBooks