
The article fails to mention that amongst all sorting methods with guaranteed O(N*log N) complexity, heapsort is the only which requires O(1) storage, but says that it requires O(N)! And just because author used Java in example code, and it is not possible to get effective and versatile containers in Java. Here is inplace heapsort. Also, the code is *MUCH* shorter.
make_heap(x,x+n);
for(int i=n;i>1;i)
pop_heap(x,x+i);
