Correct Answer - Option 4 : Neither S1 nor S2
Concept:
First, check the grammar is ambiguous or not. If a grammar is ambiguous then it cannot be LL(1) and LR(1).
Explanation:
Given grammar is: S → F | H
F → p | c
H → d | c
First derivation for “c”:
S → F → c
Second derivation for “c”:
S → H → c
Two parse tree exists for single string and hence given grammar is ambiguous. It is neither LL(1) nor LR(1).