private static int getAscRun(int[]a, int st, int end) {
        if (st == end ) {
            return 1;
        }
            int nextPos = st+1;
            if (nextPos == end) {
                return 2;
            }
            if (a[st] <= a[nextPos]) {
                while (nextPos < end && a[nextPos] <= a[nextPos+1]) {
                    nextPos++;
                }
            } else {
                while (nextPos < end && a[nextPos] > a[nextPos+1]) {
                    nextPos++;
                }
                reverseOrder(a,st,nextPos);
            }
        return nextPos-st+1;
    }