Open In App

GATE | GATE MOCK 2017 | Question 55

Like Article
Like
Save
Share
Report

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


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads