GATE | GATE MOCK 2017 | Question 55

Let G be the CFG, l be the number of left most derivations, r be the number of right most derivations and P be the number of parse trees. Assume l , r and P are computed for a particular string. For a given CFG ‘G’ and given string ‘w’, what is the relation between l , P , r ?

(A) l ≤ P ≥ r
(B) l = P = r
(C) l ≥ P ≤ r
(D) none of these


Answer: (B)

Explanation:



For any particular string :
# parse tree = # LMD’s = # RMD’s

Therefore l = P = r.


Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.