I have to implement a BubbleSort algorithm on a Linked List instead of an array. I\'m new to java so I don\'t really know how to put it in code. But I gave it a try and here
You need to implement the Comparable interface in the SinglyNode and use the string compare method inside the implementation. Something like:
public void compareTo(SinglyNode node){
return this.names.toString.compareTo(node.getNames().toString());
}
Or better just this.names.compareTo(node.getNames());
However instead of just use Object class, I would the use Comparable interface for those wildcard objects.