Problem: Sort of Sorting (https://open.kattis.com/problems/sort...)
In this video I discuss how you can sort an ArrayList. In case you haven't used an ArrayList before, you can find more on what the class can do here: https://docs.oracle.com/en/java/javas....
Regarding the compareTo function, I forgot to mention that, given two objects o1 and o2, if o1 is smaller than o2, then you should return -1, and if o1 is bigger than o2, you should return 1 (you return 0 if they are equal, as I mentioned in the video).
Video Sections:
0:00 - ArrayList
2:31 - Sorting an ArrayList
6:49 - Problem description
8:20 - Solution
10:34 - Custom Sorting using comparator
14:50 - Custom sorting using lambda operator
Please note that all views and opinions expressed in this video are my own and does not reflect that of Kattis or any other person/organisation mentioned in the video.
Auf dieser Seite können Sie das Online-Video CP-1.010 Java Tutorial - Sorting an ArrayList mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Daniel Sutantyo 14 September 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 4,606 Mal angesehen und es wurde von 55 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!