wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following grammer:
S XX
X b
X aX
Which of the following can be the viable prefixes?

A
None of these
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
baab
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
aab
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
bba
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C aab
Option (b)
  • Viable prefix is nothing but stack content in LR is visible in stack while doing parsing or not.
  • A short trick to solve such question is to check. if stack can't store at any symbol after that reduce
Option (b) is only viable prefixes.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Introduction
PHYSICS
Watch in App
Join BYJU'S Learning Program
CrossIcon