Below is the syntax highlighted version of Linearithmic.java
from §4.1 Performance.
/****************************************************************************** * Compilation: javac Linearithmic.java * Execution: java Linearithmic n * * A program with linear running time. * ******************************************************************************/ public class Linearithmic { public static void main(String[] args) { int n = Integer.parseInt(args[0]); int count = 0; for (int i = 1; i <= n; i = i*2) for (int j = 0; j < n; j++) count++; StdOut.println(count); } }