keyValueIterator

open override fun keyValueIterator(): Iterator<Pair<TKey, TValue>>

Returns an iterator over the key-value pairs in this sequence while verifying the sort order.

The iterator validates that keys are in the correct order (ascending or descending) as it traverses the sequence. If a key is found to be out of order, a SequenceNotSortedException is thrown.

Return

An iterator that yields key-value pairs in sorted order

Throws

if the sequence is not properly sorted