Cfl Final Exam Questions And Answers
With Verified Solutions 100% Correct!!!
If a grammar can be defined as:
G=(V, ∑, P, S), what does S represents?
a) Accepting State
b) Starting state
c) Sensitive Grammar
d) starting alphabet - ANSWER✔✔b) Starting State
A CFG is ambiguous if:
a) It has more than one rightmost derivations
b) It has more than one leftmost derivations
c) No parse tree can be generated for the CFG
d) The parse tree is always a binary tree - ANSWER✔✔b) It has more than one
leftmost derivations
A push down automaton employs ________ data structure.
a) Queue
b) Linked List
c) Hash Table
d) Stack - ANSWER✔✔d) Stack
The instantaneous description of a PDA has the following elements
, a) State
b) Unconsumed input
c) Stack content
d) All of the above
e) a & c only - ANSWER✔✔d) All of the above
Which among the following cannot be accepted by a finite state machine?
a) L is a set of numbers which begins with a 1 and ends with a 0
b) L is a set of numbers which contain at least three 1s
c) L is a set of strings with odd number of 0
d) L is a set of strings where 0^n*1^n - ANSWER✔✔d) L is a set of strings where
0^n*1^n
Which of the following statement is correct?
a) All Regular languages are context free but not vice versa
b) All context free languages are regular languages but not vice versa
c) Regular grammar and context free grammar are the same entity
d) Answer depends on the language - ANSWER✔✔a) All Regular languages are
context free but not vice versa
Can an ambiguous grammar be context free?
a) Yes
b) No - ANSWER✔✔a) Yes
With Verified Solutions 100% Correct!!!
If a grammar can be defined as:
G=(V, ∑, P, S), what does S represents?
a) Accepting State
b) Starting state
c) Sensitive Grammar
d) starting alphabet - ANSWER✔✔b) Starting State
A CFG is ambiguous if:
a) It has more than one rightmost derivations
b) It has more than one leftmost derivations
c) No parse tree can be generated for the CFG
d) The parse tree is always a binary tree - ANSWER✔✔b) It has more than one
leftmost derivations
A push down automaton employs ________ data structure.
a) Queue
b) Linked List
c) Hash Table
d) Stack - ANSWER✔✔d) Stack
The instantaneous description of a PDA has the following elements
, a) State
b) Unconsumed input
c) Stack content
d) All of the above
e) a & c only - ANSWER✔✔d) All of the above
Which among the following cannot be accepted by a finite state machine?
a) L is a set of numbers which begins with a 1 and ends with a 0
b) L is a set of numbers which contain at least three 1s
c) L is a set of strings with odd number of 0
d) L is a set of strings where 0^n*1^n - ANSWER✔✔d) L is a set of strings where
0^n*1^n
Which of the following statement is correct?
a) All Regular languages are context free but not vice versa
b) All context free languages are regular languages but not vice versa
c) Regular grammar and context free grammar are the same entity
d) Answer depends on the language - ANSWER✔✔a) All Regular languages are
context free but not vice versa
Can an ambiguous grammar be context free?
a) Yes
b) No - ANSWER✔✔a) Yes