Back to problems

Chain Merge

Algorithm · Rubrik · Hard

You are managing a garbage-collection system composed of n independent chains, labeled C_1, C_2, ..., C_n. Each chain is a straight-line dependency graph: a sequence of blobs where every blob (except the first) depends on its immediate parent. A blob B_{i,j} in chain C_i (position j, 1-indexed) has a known retention time. A blob becomes eligible for removal only when both of these conditions hold: Its own retention time has elapsed. No other blob anywhere in the system still…

Checking your access…