I'm attempting to sort a deque list containing a set of structures.
The structure is declared as follows:
struct coords
{
int x;
int y;
int score;
coords* parent;
}
The deque list is declared as follows:
deque <coords*> openList;
The list is filled with a set of coords* and i need to sort the list by the value of score. Im completely at a loss. This is for the Best First Search.
Just to add on, for coords* o1 and coords* o2 the passed in value can be NULL so it is actually safer to check explicitly for NULL. Reference variables don't suffer from this problem though as they always have to point to something.