I have to check to see if the "tokens" in the arraylist are in increasing order.
private E[] data; // where the data is stored
private int size; // how many items have been added to the list
public TopSpinArray(int numTokens, int spinSize)
{
super(numTokens, spinSize);
data = (E[])(new Object[numTokens]);
size = 0;
}
public boolean isSolved()
{
for(int i = 0; i < numTokens; i++)
{
if(data[i] < data[i+1])
{
return true;
}
}
return false;
}
when I compile, it says "bad operand types for binary operator '<' first type: E; second type: E"
how do I check to see if they are increasing?
array, not anArrayList.