fn is_sorted<I>(data: I) -> boolwhere I: Iterator, I::Item: Ord + Clone,
Checks if a given list is sorted.