javalinked-list

Java how to sort a Linked List?


I am needing to sort a linked list alphabetically. I have a Linked List full of passengers names and need the passengers name to be sorted alphabetically. How would one do this? Anyone have any references or videos?


Solution

  • You can use Collections#sort to sort things alphabetically.