Function checkSortedArray

Check the invariants of a SortedArray.

If the SortedArray is corrupted.