47 Jilid 18, Bil. 2 (Disember 2006) Jurnal Teknologi Maklumat A FASTER EXTERNAL SORTING ALGORITHM USING NO ADDITIONAL DISK SPACE Md. Rafiqul Islam + , Mohd. Noor Md. Sap ++ , Md. Sumon Sarker + , Sk. Razibul Islam + + Computer Science and Engineering Discipline, Khulna University, Khulna-9208, Bangladesh. ++ Faculty of Computer Science and Information System, University of Technology Malaysia, Skudai, Johor Bahru, Malaysia dmri1978@yahoo.com, mohdnoor@fsksm.utm.my, sumonsrkr@yahoo.com, optimist_2195@yahoo.com Abstract The effective performance of the external sorting is analyzed in terms of both time and I/O complexities. This paper is concerned with a more efficient external sorting algorithm, where both the time and I/O (read and write) complexities have been reduced. The proposed method is a hybrid technique that uses quick sort and merge sort in two distinct phases. Both the time and I/O complexities of the proposed algorithm are analyzed here and compared with the complexities of the existing similar algorithms. The proposed algorithm uses special in-place merging technique, which creates no extra backup file for manipulating huge records. For this, the algorithm saves huge disk space, which is needed to hold the large file. This also reduces time complexity and makes the algorithm faster. Keywords: complexity, external sorting, in-place merging, quick sort, runs. 1. INTRODUCTION Sorting means to arrange records or data in an ascending or descending order. But when the size of the records become so much larger than the internal memory can hold at a time, then the situation arise to use external sorting. It is quite different from internal sorting, even though the problem in both cases is to sort a given file into increasing or decreasing order. The most common external sorting algorithm still uses the merge sort as described by Knuth [1]. In balanced two-way merge, runs (sorted records which can fit into the internal memory) are distributed over two external files and another two external files are used to hold the merged runs of the previous external files. After each merge the length of runs becomes double. When all the runs are merged into a single run, the process stops. The key drawback of this process is that it requires extra disk space. Dufrene and Lin [2] and M. R. Islam et al. [3] proposed their algorithms in which no external file is needed; only the original file is used. M. R. Islam et al. [4][5] proposed an algorithm that uses no extra disk space and faster than both the algorithms proposed by Dufrene and Lin [2] and M. R. Islam et al. [3]. Here we have proposed an efficient external sorting algorithm with no additional disk space based on the algorithms proposed by Dufrene and Lin [2], M. R. Islam et al. [4] and M. R. Islam et al.