Computer Sciences > GATE 2024 Set-2 > Grammars
Consider a context-free grammar G with the following 3 rules.
S → aS,
S → aSbS,
S → c
Let w ∈ L(G). Let na(w), nb(w), nc(w) denote the number of times a, b, c occur in w, respectively. Which of the following statements is/are TRUE?
A
na(w) > nb(w)
B
na(w) > nc(w) - 2
C
nc(w) = nb(w) + 1
D
nc(w) = nb(w) * 2

Explanation

Correct : a,b,c

Similar Questions

What is the worst-case time complexity of insertion in an AVL tree?
Question #23 Medium
Which operations on a binary search tree have O(h) complexity?
Question #31 Easy
Compare search complexities of sorted array vs balanced BST.
Question #47 Hard

Related Topics

Data Structures Binary Search Tree Time Complexity Algorithm Analysis Tree Algorithms Computer Science