5 votes 5 votes How to do this type of QUESTIONS? Consider following grammar : S → S1 + A | A A → D – A | D D → D1 * B | B B → num The number of internal nodes for the parse tree for 5 * 4 + 10 * 6 – 7 – 8 Compiler Design compiler-design grammar parsing numerical-answers + – vishwa ratna asked Jan 18, 2017 • retagged Jun 19, 2022 by Lakshman Bhaiya vishwa ratna 2.8k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 5 votes 5 votes Parse tree for $5 * 4 + 10 * 6 – 7 – 8$ based on above grammar will contains $18$ internal nodes and $6$ leaf nodes. PS:) Will update this answer after Gate with Parse tree drawn mcjoshi answered Jan 18, 2017 • selected Jan 31, 2017 by Sushant Gokhale mcjoshi comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments mcjoshi commented Jan 31, 2017 reply Follow Share I know the difference. Iam counting $18$ in parse tree Thanks again bro :) 1 votes 1 votes rasto mapp commented Sep 8, 2017 reply Follow Share @air1 2 votes 2 votes nilubabu2 commented Oct 13, 2018 reply Follow Share Sir, Shall we incldue start node (s) with internal node means 17 + 1(start node So = 18 ? 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes Internal node-18 Leaf node->6 Prateek kumar answered Jan 4, 2018 Prateek kumar comment Share Follow See all 0 reply Please log in or register to add a comment.