Discussion
An expression tree contains 7 binary operators and no unary ones. Translating it with one operator per instruction yields how many temporaries?
Answer: C
Each binary operator yields exactly one result, and each result needs one temporary, so the counts are equal: \[ \text{temporaries} = \text{operators} = 7 \] Optimisation may afterwards reduce how many actually occupy storage, since a temporary that is consumed immediately need not survive; register allocation is where that reduction really happens. The count of 7 is the number generated, not the number ultimately stored.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development