in Compiler Design recategorized by
1,680 views
3 votes
3 votes

 

Find the lexicographic ordering of the bit strings given below based on the ordering $0<1$.

  1. $001$
  2. $010$
  3. $011$
  4. $0001$
  5. $0101$

Choose the correct answer from the options given below:

  1. $001 < 010 < 011 < 0001 < 0101$
  2. $0001 < 001 < 010 < 0101 < 011$
  3. $0001 < 0101 < 001 < 010 < 011$
  4. $001 < 010 < 0001 < 0101 < 011$
in Compiler Design recategorized by
1.7k views

1 Answer

5 votes
5 votes

 Lexicographic ordering (or dictionary ordering) since 0<1      0 appears before 1

 Right ans option  B)  0001<001<010<0101<011

for better understanding replace 0 by A and 1 by B  now arrange  alphabetically

AAAB<AAB<ABA<ABAB<ABB

Answer:

Related questions