This page is old and outdated. It has been replaced by:
http://www.digsys.se/JavaScript/QSort.aspx
Please update your links and favorites.
Quick sort is a popular sort method. However the recursive algorithm may cause stack overflow. Here is a quick sort method that uses a small stack space.
Due to execution time in JavaScript, max 4096 lines are allowed.