Professional Documents
Culture Documents
TCS Question Paper-2
TCS Question Paper-2
c) Proper Suffix and Prefix of a string: A proper prefix of a string is any prefix of the
string except the string itself. Similarly, a proper suffix of a string is any suffix of the
string except the string itself. For example, for the string “abc”, “a” and “ab” are
proper prefixes, and “c” and “bc” are proper suffixes.
d) Pushdown Automata: A Pushdown Automaton (PDA) is formally defined as a 7-
tuple (Q, Σ, Γ, δ, q0, Z0, F) where: - Q is a finite set of states. - Σ is a finite set of
input symbols. - Γ is a finite set of stack symbols. - δ is a transition function mapping
Q x (Σ U {ε}) x Γ to a finite subset of Q x Γ*. - q0 is the initial state. - Z0 is the initial
stack symbol. - F is the set of accepting states.
e) Left linear and right linear grammar: A grammar is called left linear if all its
production rules are of the form A -> αB or A -> α, where A and B are non-terminal
symbols and α is a string of terminal symbols. Similarly, a grammar is called right
linear if all its production rules are of the form A -> Bα or A -> α.
FA doesn’t have any space to store PDA has an additional stack for
Memory
input alphabets storing long sequence of alphabets