Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE-CS-2015 (Set 2) | Question 65

  • Difficulty Level : Hard
  • Last Updated : 17 Sep, 2021
Geek Week

In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is True?
(A) 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
(B) For any input program, neither AST nor CFG will contain a cycle
(C) The maximum number of successors of a node in an AST and a CFG depends on the input program
(D) Each node in AST and CFG corresponds to at most one statement in the input program

Answer: (C)


(A) is false, In CFG (Control Flow Graph), code of N2
may be present before N1 when there is a loop or goto.

(B) is false, CFG (Control Flow Graph) contains cycle
when input program has loop.

(C) is true, successors in AST and CFG depedend on
input program

(D) is false, a single statement may belong to a block
of statements. 

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up