GATE Computer ScienceHardGATE CS
A floating-point literal is defined over the symbols d (digit), '.', e and s (sign) as d⁺ ( . d⁺ )? ( e s? d⁺ )?. How many states does the minimal complete DFA (dead state included) for this pattern have?
- A. 10
- B. 7
- C. 9
- D. 8
Correct answer: D. 8
The states are: start; after the integer digits (accepting); after '.'; after fractional digits (accepting); after e; after the sign; after exponent digits (accepting); and the dead state. The e reached from an integer and from a fraction lead to the same state, so no more states are needed: 8.
More Compiler Design questions
- A C comment is / followed by any text that does not contain / followed by / . Over the alphabet { /, , x } the language is /([^]|+[^/])+/…
- A flow graph has nodes 1 to 10, entry node 1, and edges 1→2, 2→3, 3→4, 4→5, 5→3, 4→6, 6→7, 7→2, 7→8, 8→9, 9→8, 9→10, 6→10, 3→9. A back…
- For the flow graph with entry 1 and edges 1→2, 2→3, 3→4, 4→5, 5→3, 4→6, 6→7, 7→2, 7→8, 8→9, 9→8, 9→10, 6→10, 3→9, which is the dominance…
- An expression is very busy at a point if, along every path from that point, it is evaluated before any of its operands is redefined…
- A heap holds objects A to J. Roots point to A and E. Pointers: A→B, B→C, B→D, C→B, D→F, E→F, E→I, G→H, H→G, H→J. The root pointer to A is…
- The live ranges (inclusive of both end points, in instruction numbers) of ten variables are [1,8], [2,5], [3,9], [4,6], [7,12], [10,14]…