I have an array, and I want to compare elements between each other, but want to avoid comparing them more than once, so in other words, once I compare array[0] with array[1], I don't want to compare again array[1] with array[0], I will end up having this code:
for(var i:int = 0; i < array.lenght; i++){
var entity:Object = array[i];
for(var j:int = i; j < array.lenght; j++){
//do stuff
}
}
This is not O(N^2), maybe it is O(logN)?. What method do you use to calculate this?.