Here you can find the source of rosettaShell(ArrayList
public static void rosettaShell(ArrayList<Character> a)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Main { static Logger logger = LoggerFactory.getLogger("UTIL5"); public static void rosettaShell(ArrayList<Character> a) { int increment = a.size() / 2; int estimatedBytesI = 0; //while (increment > 0) { for (int p = 0; p < 5; p++) { logger.info("increment is: " + increment); int count = 0; for (int i = increment; i < a.size(); i++) { count++;/*w w w . ja va2s.c o m*/ int j = i; char temp = a.get(i); while (j >= increment && a.get(j - increment) > temp) { a.set(j, a.get(j - increment)); j = j - increment; } a.set(j, temp); } if (increment == 2) { increment = 1; } else { increment *= (5.0 / 11); } logger.info(count + ""); logger.info("estimated bytes is: " + (count / 8)); estimatedBytesI += (count / 8); } logger.info("estimated bytes of meta data is: " + estimatedBytesI + "\n"); } }