Question
The average weight of 15 men is 70 kg. One man leaves
the group and another man weighing 82 kg joins the group. The new average becomes 71 kg. Find the weight of the man who left.Solution
Total weight of 15 men initially = 15 Γ 70 = 1050 kg After replacement, there are still 15 men with average 71 kg: New total = 15 Γ 71 = 1065 kg Let weight of man who left = x kg. Then: New total = Old total β x + 82 1065 = 1050 β x + 82 1065 = 1132 β x x = 1132 β 1065 = 67 kg Answer: The man who left weighed 67 kg.
Which optimization technique involves replacing a sequence of instructions with a shorter or faster sequence, often by looking at a small "window" of in...
An S-attributed SDD (Syntax-Directed Definition) is one where:
Multithreading an interactive program will increase responsiveness to the user by ___________
The primary goal of code optimization is to:
Which memory allocation strategy is used for global variables and static variables, where memory is allocated once at compile time and remains throughou...
Which parsing method uses a stack and an input buffer?
A 3-address instruction typically has the form:
Which optimization is performed after intermediate code generation?
Which of the following parsers is the most powerful (can parse the largest class of grammars)?
Which phase of compilation groups characters into tokens?