Java how to sort a Linked List?

allencoded picture allencoded · Jun 6, 2011 · Viewed 153.2k times · Source

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?

Answer

mre picture mre · Jun 6, 2011

You can use Collections#sort to sort things alphabetically.