Question
Two pipes A and B can fill a tank in 24 min., and 32
min, respectively. If both the pipes are opened simultaneously, after how much time B should be closed so that the tank is full in 18 minutes?Solution
Let B be closed after x minutes. Then, Part filled by (A+B) in x min. + part filled by A in (18 – x) min. = 1 x (1/24  +  1/32) + (18 – x )  × 1/24  = 1 ⟹  7x/96  +  (18-x)/24   = 1 ⟹7 x + 4 (18 – x) = 96 ∴ x = 8 ∴ Hence, B must be closed after 8 minutes. Alternate Solution: A        B 24       32 LCM = 96 4   :     3 B is closed in between hence A filled for whole all time so A filled in 18 hrs = 18
4 = 72 units So rest work (96-72=24) is done by B in = 24/3 = 8 min hence B is closed by 8 min
A "shift-reduce" parser is a type of:
In a Syntax-Directed Definition (SDD), attributes are associated with:
Which of these is used for resolving operator precedence in parsing?
Which of the following grammars is suitable for top-down parsing?
Dynamic memory allocation (e.g., using `malloc` or `new`) typically occurs in which part of the runtime memory?
"Dead code elimination" is an optimization that removes:
Which data structure is commonly used in implementing a recursive descent parser?
Which parser is most commonly used in modern compilers?
What is the primary purpose of a "symbol table" in a compiler's runtime environment?
The primary goal of code optimization is to: