"Roman Mashak" <> wrote
> Is there an easy way to determine that array e.g. int X[N] contains
> ordered items (for example, ascending), except running loop with
> comparison of items?
>
> It would be good to provide me with some useful link 
>
No way of doing what you wnat in less than O(N) time.
However if you know the propeties of your array you can do a "good enough"
test by taking the start, the end, the middle, and the second and third
quartiles. The chance of these being in order by chance is relatively low.
(5!, or 1 in 120) In addition if the middle is very approximately the mean
of the middle three, and you know the distribution is either unform or with
a symmetrical central peak, then it is pretty certain that the array is
ordered.
What the test won't detect is slight deviations from orderedness, for
instnace by swapping one pair of elements. These could be malicious or they
could be because ordering is not random. However the chance of them arising
from a random distribution is vanishingly small.