in Others edited by
231 views
0 votes
0 votes

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)?

  1. $a\:b$
  2. $b\:b$
  3. $b\:a$
  4. $b\:a\:a\:b$
in Others edited by
231 views

1 Answer

1 vote
1 vote
input is : a b b a a b b a a b

so the dictionary contains: a | b | ba | ab| baa | b (is already there)

so option B and D both r not there in dicto

4 Comments

Sir ,on which basis you are dividing the sequence.... ?
0
0
Sequence to divide kro jb TK different squence bne pehle wali sequence repeat nhi honi chahiye

Ab ba ab fir se ab nhi le sakte so we take abb etx
1
1
can you pls elaborate the answer ?

what is meant by LZ- Coding ?

thanks in advance
0
0
Initially my dictionary is empty.

now from input  I see first  a   . . I check is my dictionary having single a ? No. So i keep one a in my diction

From input next I see one b. . Is my dictionary having single b? No. So I keep a single b in it.

Next from input I see next b. I check is there any single b kept in dictionary? Yes. So I can't keep any more single b in it. So b is in my hand. Next input is a. Now in my hand I have ba. I check is the dictionary have any entry ba? No. So I keep ba in my dictionary. .

Then I check and store ab.

Then I check and store baa.

Hope clear now.

Regards.
4
4
Answer:

Related questions