Here you can find the source of minList(int[] listA, int[] listB)
public static int[] minList(int[] listA, int[] listB)
//package com.java2s; //License from project: Apache License public class Main { public static int[] minList(int[] listA, int[] listB) { int maxSize = Math.max(listA.length, listB.length); int[] minList = new int[maxSize]; for (int i = 0; i < maxSize; i++) { int valueA = i < listA.length ? listA[i] : Integer.MAX_VALUE; int valueB = i < listB.length ? listB[i] : Integer.MAX_VALUE; valueA = valueA >= 0 ? valueA : Integer.MAX_VALUE; valueB = valueB >= 0 ? valueB : Integer.MAX_VALUE; int minValue = Math.min(valueA, valueB); if (minValue == Integer.MAX_VALUE) minValue = -1;//from w ww.ja va2 s . co m minList[i] = minValue; } return minList; } }