Thanks a bunch, phinds. And thanks Heulsay, for that code. I shall surely use it when I need shell sort. It is believed that QuickSort is the fastest.