Sequence scan segmentation algorithm