check sortedness of sparse representation