private static LinkedList<Integer> melhorMoto1 = new LinkedList<>();
I know I can do something like create a new LinkedList, use newLinkedList = melhorMoto1;
and do Collections.sort(newLinkedList);
and newLinkedList.equals(melhorMoto1 );
but as I'm working with recursive function, the newLinkedList = melhorMoto1;
is a very slow attribution. Can I check if the LinkedList is ordered with a method or something?