From the given data below :
a b b a a b b a a b
which one of the following is not a word in the dictionary created by LZ-coding (the initial words are a, b)?
(A) a b
(B) b b
(C) b a
(D) b a a b
Answer: (B) (D)
Explanation: Input is : a b b a a b b a a b
According to L-Z coding:
The dictionary contains: a | b | ba | ab| baa (is already there)
baab and bb are not there
So, option B and D are correct.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.