In your problem where you need to remove the smallest value, you could replace the value by the last element of the list and reduce the list length by one. This would change the order of values but would be much simpler to implement. You must then add a variable holding the number of values left in the array to examine. This is as fast as a linked list remove operation.

Thus in your case both solutions are equivalent.

Though if you need to implement this in a 2D array, playing with linked list becomes really tricky. The second solution is then much simpler to implement.

About your programming problem, you look really in trouble.

ABout your void* error message you simply need to put a cast in front of the malloc operation. malloc returns a void* and you want to store the value into a double *. This is just a type checking problem.