protected void sortHorseList(int iHorseCount)
{
int i = 0;
Horsie currentNode = head;
Horsie auxNode = new Horsie();
boolean foundChange = true;
while(foundChange)
{
foundChange = false;
for(i=0; i<iHorseCount-1; i++)
{
if (currentNode.getHorseValue() > currentNode.getNext().getHorseValue())
{
auxNode.setHorseValue(currentNode.getHorseValue());
currentNode.setHorseValue(currentNode.getNext().getHorseValue());
currentNode.getNext().setHorseValue(auxNode.getHorseValue());
foundChange = true;
}
currentNode = currentNode.getNext();
}
}
}
This code displays a null pointer error when running the main program. I am a novice at data structure, and I'm hoping to solve this problem with your help guys! Please teach me how to use bubble sort in a doubly linked list...HEEELP!