Linearly traverse the directory structure Compare timestamp of current file to timestamp of oldest/last item in queue If file is newer Seek (the sorted) insertion point in the queue, and insert via splice If queue size > N pop off the oldest element from the queue Repeat until finished...