Skip to content

Instantly share code, notes, and snippets.

@vicegd
Created February 18, 2016 10:18
assigned()
/**
* Checks whether a condition is true, i.e., if a task is assigned
* to the current solution state
* @param task We want to assign, and we're going to look for it
* in the array of state (sol[])
* @return True if the task is already assigned so it would not be
* valid to assign the same task again
*/
private boolean assigned(int task) {
for (int i=0; i<n; i++)
if (sol[i]==task) //it is already assigned
return true;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment