Hey, im trying to figure out how to write a comparTo method for my circular doubly linked list. Ive only writen one for primitive data types link int. So I cant figure out how to make it work for a linked list. Ive tried lots of different ways and combinations but I cant get the syntax right so it wont even compile. Im useing it for a sorting routine so I want it to look at 2 elements at a time and switch if one is greater or do nothing if they are the same.
public class Node implements Comparable<Node>
public int compareTo(Node that)
if(( this.data).compareTo(that.data) > 0)
//..... rest of Node class