Contents    Prev    Next    Page+10   

Which of the following languages is not Regular:

  • A: all possible ASCII files
  • B: all strings of properly nested and balanced parentheses
  • C: all words in the Oxford English Dictionary
  • D: integer numbers of any length
  • E: all of the above

    Answer:   B

    Properly balanced and nested parentheses requires counting parentheses. This can be done by pushing parens onto a stack, then popping them when a matching paren is found; a stack is used to parse a Context Free language. In general, any language that requires counting must be at least Context Free. This would include markup languages such as XML and HTML.