查找错误
Node node = head;//create a new node
while(node.next != null){
if(node.data>node.next.data){ //comparing next node and node
int x;
x = node.data;
node.data = node.next.data; //changing the value of next node and current node
node.next.data = x;
}
node = node.next; //changing to next node
}