A constant-space linear-time algorithm for deleting all but the 10 most recent files in a directory
Raymond Chen presents a constant-space, linear-time algorithm to delete all but the ten most recent files in a directory, using a priority queue (min-heap) as the core data structure to efficiently track and discard older files during a single pass.