The binary search algorithm allows elements to be located in sorted sequence in O(log n) time.

Variants of sequence words optimized for sorted sequences:

See also

Ordering specifiers, Sorting sequences

search ( seq quot: ( elt -- <=> ) -- i elt )

Variants of sequence words optimized for sorted sequences:

sorted-index ( obj seq -- i )

sorted-member? ( obj seq -- ? )

sorted-member-eq? ( obj seq -- ? )

See also

Ordering specifiers, Sorting sequences