Java List Sort isSortedDescending(List list)

Here you can find the source of isSortedDescending(List list)

Description

is Sorted Descending

License

Open Source License

Declaration

public static boolean isSortedDescending(List<Integer> list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static boolean isSortedDescending(List<Integer> list) {
        if (list.size() < 2)
            return true;

        for (int i = 1; i < list.size(); i++) {
            if (list.get(i - 1) < list.get(i)) {
                return false;
            }/*from www.  j  a  v  a  2  s  . com*/
        }
        return true;
    }
}

Related

  1. isSorted(List> items, boolean asc)
  2. isSorted(List list, Comparator c)
  3. isSorted(List list)
  4. isSorted(List list)
  5. isSorted(List list)
  6. isStringListSortedDesc(List list)
  7. isUnsortedEventsMatch(List actual, List expected)
  8. ListToSortedArray(List list)
  9. mapTosortedScoreList(HashMap unSortedMap)