Hi, Ive done program that reads in coordinates from text file and stores them in double linked list. After coordinates are read in algorithm calculates its importance. User selects number of coordinates he wants to remove. Then program finds double linked list element with lowest importance value and removes it from list. Problem I have is that when search is done and node is find, when trying to remove it, it cant find it. Could you please advice me or point out what i did wrong.
for (current = current->next; current != NULL; current = current->next)
{
if (current->F < f)
{
f = current->F;
// save the node here as well instead of searching for f again afterwards
lowest = current;
}
}
Then you could remove this line: lowest = search(f);
Compare this if condition with the condition of your loop if (p->next != NULL && (p->next->x == x && p->next->y == y && p->next->F == F))
Hint: your loop terminates before u reach the node you want to delete