Constant segment of an array
= Constant segment of an array
A contiguous segment whose elements all have the same value. Its longest suffix after scanning a new element extends the previous constant suffix when the adjacent values agree, and otherwise starts again with length one. Keeping the largest suffix length seen gives a <linear time> longest-segment scan.