Question
Who sits opposite to
F? Study the following information carefully and answer the given Questions: Three teachers and five students A,B,C,D,E,F,G and H are sitting around a square table facing the centre such that four people sit at four corners and rest of them sit between them. They study / teach three subjects, i.e., Maths, Computers and Accounts. Students sit adjacent to their respective teachers. Each teacher and student studies/ teaches only one subject. (i) H, who is a student, sits at one of the corners. He does not study Computers. (ii) D, a teacher sits opposite to H and teaches Maths to students sitting adjacent to him. (iii) Only one student studies Computers, and is sitting third to the right of the person who teaches Maths. (iv) A is not a teacher and sits at one of the corners. (v) C sits to the immediate left of F. F is not a student. (vi) E sits opposite to C. B does not study Maths.Solution
From (i) and (ii), if H sits at place no. 5, then D sits at place 1. Also people sitting adjacent to him at place 2 and 8 are students and learn maths. Since H does not study computers and maths, therefore he learns accounts.
From (iii), it is clear that the person sitting at place 4 is a student and studies computers. The one sitting at place 3 is a teacher who teaches computers. Also, person sitting at place 6 and 7 will be teacher and student respectively studying accounts.
From (iv), A will sit at place no 7. From (v), it is clear that since F is not a student, F sits at either place 3 or 6. C sits immediate left of F, hence, F sits at place no. 3 and C sits at place no. 2.
From (vi), E sits at place no. 6. Since B does not study maths, he studies computers and sits at place no. 4. G sits at place no. 8.
Now we can answer all the questions with the help of the above arrangement:
Which phase of the compiler ensures that identifiers are declared before they are used?
A grammar that produces multiple parse trees for the same input string is called:
Which of the following grammars is suitable for top-down parsing?
Which of the following is the first phase of a compiler?
If an expression `x = a + b` is computed, and later in the same basic block, `y = a + b` is computed, a compiler can apply which optimization?
Which LR parser is often preferred in practice because it offers a good balance between power and table size, resolving most conflicts that SLR(1) cannot?
Which of the following parsers is the most powerful (can parse the largest class of grammars)?
Which of the following tools is commonly used to generate a lexical analyzer (scanner) from a set of regular expressions?
What is a primary advantage of generating intermediate code during compilation?
Which parsing method uses a stack and an input buffer?