{"id":"merge-scan-extends-sort-pipeline-to-dual-inputs","text":"The merge-scan pattern is the canonical extension of the sort-then-two-pointer pipeline to problems with two pre-sorted input sequences: instead of sorting a single array then scanning with converging pointers, it interleaves two already-sorted inputs using advancing pointers, preserving the pipeline's structure while accepting dual inputs.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["merge-scan-pattern-for-sorted-pair-processing","sort-then-two-pointer-dominant-pair-pipeline"],"outlist":[],"label":"merge-scan preserves sort-then-scan's structure while generalizing to dual sorted inputs"}],"dependents":["cursor-streaming-unifies-input-multiplicity"],"metadata":{"source_type":"derived","last_reviewed":"2026-06-07T22:02:22","review_result":"pass"},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"merge-scan-extends-sort-pipeline-to-dual-inputs","truth_value":"IN","reason":"SL justification valid","antecedents":["merge-scan-pattern-for-sorted-pair-processing","sort-then-two-pointer-dominant-pair-pipeline"],"label":"merge-scan preserves sort-then-scan's structure while generalizing to dual sorted inputs"},{"node":"merge-scan-pattern-for-sorted-pair-processing","truth_value":"IN","reason":"SL justification valid","antecedents":["merge-alternately-linear-complexity","merge-nums-two-pointer-linear-time","two-pointer-merge-scan-for-sorted-intersection"],"label":"Depth-1 cross-problem grouping: three solutions independently instantiate the same merge-scan template with different actions at the match/advance points"},{"node":"merge-alternately-linear-complexity","truth_value":"IN","reason":"premise"},{"node":"merge-nums-two-pointer-linear-time","truth_value":"IN","reason":"premise"},{"node":"two-pointer-merge-scan-for-sorted-intersection","truth_value":"IN","reason":"premise"},{"node":"sort-then-two-pointer-dominant-pair-pipeline","truth_value":"IN","reason":"SL justification valid","antecedents":["sort-preprocessing-enables-linear-scan","two-pointer-primary-linear-array-technique"],"label":"sort provides the sorted precondition that two-pointer inward sweep and sorted-pair matching require; these two depth-1 patterns co-occur in two-sum-less-than-k, array-partition, and meeting-rooms families"},{"node":"sort-preprocessing-enables-linear-scan","truth_value":"IN","reason":"SL justification valid","antecedents":["sort-then-two-pointer-pattern","meeting-rooms-sort-then-scan","array-partition-sort-greedy","subsequence-limited-sum-greedy-sort"],"label":"Sorting is the universal complexity bridge from quadratic brute-force to n-log-n solutions"},{"node":"sort-then-two-pointer-pattern","truth_value":"IN","reason":"premise"},{"node":"meeting-rooms-sort-then-scan","truth_value":"IN","reason":"premise"},{"node":"array-partition-sort-greedy","truth_value":"IN","reason":"premise"},{"node":"subsequence-limited-sum-greedy-sort","truth_value":"IN","reason":"premise"},{"node":"two-pointer-primary-linear-array-technique","truth_value":"IN","reason":"SL justification valid","antecedents":["two-pointer-convergence-linear-time","two-pointer-sorted-array-pattern","two-pointer-backward-fill-avoids-sort","sort-then-two-pointer-pattern"],"label":"Two-pointer subsumes multiple problem families into a single O(n) framework"},{"node":"two-pointer-convergence-linear-time","truth_value":"IN","reason":"premise"},{"node":"two-pointer-sorted-array-pattern","truth_value":"IN","reason":"premise"},{"node":"two-pointer-backward-fill-avoids-sort","truth_value":"IN","reason":"premise"}]}}