public static void sort(String[] array) {
		if (array == null)
			return;
		
		int startIndex = 0;
		int endIndex = array.length - 1;
		
		int leftLength = 1;
		int leftIndex = 0;
		
		int rightLength = findMaxLength(array);
		int rightIndex = endIndex;
		
		int currentIndex = 0;
		String temp;
		
		// sort length 1 and maxLength strings to opposite ends on first pass, 2 and maxLength - 1 to inner opposite ends on second pass, and so on
		// maxLength / 2 passes at most
		while (leftIndex < rightIndex && leftLength < rightLength) {
			while (currentIndex <= rightIndex) {
				if (array[rightIndex].length() == rightLength) { // special case if rightIndex is already a rightLength
					rightIndex--;
				} else if (array[rightIndex].length() == leftLength) { // special case if rightIndex is a leftLength
					if (currentIndex == leftIndex)
						currentIndex++;
					temp = array[leftIndex];
					array[leftIndex++] = array[rightIndex];
					array[rightIndex] = temp;
				} else { // normal case
					if (array[currentIndex].length() == leftLength) {
						temp = array[leftIndex];
						array[leftIndex++] = array[currentIndex];
						array[currentIndex] = temp;
					} else if (array[currentIndex].length() == rightLength) {
						temp = array[rightIndex];
						array[rightIndex--] = array[currentIndex];
						array[currentIndex] = temp;
					}
					currentIndex++;
				}
			}
			
			sortLexico(array, startIndex, leftIndex - 1, 0, leftLength);
			sortLexico(array, rightIndex + 1, endIndex, 0, rightLength);
			
			currentIndex = leftIndex;
			leftLength++;
			rightLength--;
			
			startIndex = leftIndex;
			endIndex = rightIndex;
		}	
	}