Question 91
In expression tree labeling, if label(left) = l1 and label(right) = l2 with l1 != l2, what is the label of the parent node?
Sethi-Ullman rule: If label(left) != label(right), label(parent) = max(label(left), label(right)).
In expression tree labeling, if label(left) = l1 and label(right) = l2 with l1 != l2, what is the label of the parent node?
Sethi-Ullman rule: If label(left) != label(right), label(parent) = max(label(left), label(right)).
Which garbage collection technique maintains an explicit count of references to each heap object, reclaiming memory immediately when the count drops to 0?
Reference counting tracks pointer references in real time, freeing objects immediately when reference count reaches zero.
What is a major limitation of basic Reference Counting garbage collection?
Circular references maintain non-zero reference counts even when unreachable from root pointers, causing memory leaks in pure reference counting systems.
Which garbage collection algorithm operates in two phases: first traversing root pointers to flag reachable objects, and second scanning heap memory to collect unflagged objects?
Mark-and-Sweep: Phase 1 (Mark) traverses pointer graphs marking reachable objects. Phase 2 (Sweep) scans the heap and reclaims unmarked blocks.
In runtime environments, parameter passing by 'Reference' means:
Pass-by-reference passes memory addresses, allowing formal parameter modifications to directly alter the caller's variable value.