Here you can find the source of fillArrayWithHalfSorted(int[] nums)
public static void fillArrayWithHalfSorted(int[] nums)
//package com.java2s; //License from project: Open Source License public class Main { public static void fillArrayWithHalfSorted(int[] nums) { // first part is sorted for (int i = 0; i < nums.length / 2; i++) nums[i] = i;/*from w ww . j a v a2s . co m*/ // reverse ordered from middle int start = nums.length; for (int i = nums.length / 2; i < nums.length; i++) nums[i] = start--; } }