How can I sort an arraylist without using collections.sort()? [duplicate]
问题 This question already has answers here : sorting integers in order lowest to highest java (7 answers) Closed 5 years ago . I have been looking for a while for a way to sort an arraylist without using collections.sort as my own logic is flawed and I have been having a lot of trouble. I need to sort it in a way that I can use a method I created that basically does what collections.swap does in order to completely sort an arraylist. Here is my code: public static void mySort(ArrayList<Double>