Home » Theory of Computation » Theory of computation miscellaneous » Question

Theory of computation miscellaneous

Theory of Computation

  1. In the context of Abstract-Systax-Tree (AST) and ControlFlow-Graph (CFG), which one of the following is TRUE?
    1. In both AST and CFG, let node N2 be the successor of node N1. In the input program, the code corresponding to N2 is present after the code corresponding to N1
    2. For any input program, neither AST nor CFG will contain a cycle
    3. The maximum number of successors of a node in an AST and a CFG depends on the input program
    4. Each node in AST and CFG corresponds to at most one statement in the input program.
Correct Option: C

Option (a) is false when CFG contains cycle Option (b) is false as CFG can contain cycle Option (d) is false as a single node can contain block of statements.



Your comments will be displayed only after manual approval.