| F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal of Computing, 1(1):31--39, 1972. |
....are listed by Gusfield in [10, Chapter 7] A crucial component of our algorithm is the representation of a leaf list by a collection of search trees, such that the leaf list of a node in the su#x tree of S can be constructed from the leaf lists of the children by e#cient merging. Hwang and Lin [13] described how to optimally merge two sorted lists of length n 1 and n 2 , where n 1 n 2 , with ) comparisons. Brown and Tarjan [7] described how to achieve the same number of comparisons for merging two AVL trees in time ) and Huddleston and Mehlhorn [12] showed a similar result for ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal of Computing, 1(1):31--39, 1972.
....are listed by Gusfield in [10, Chapter 7] A crucial component of our algorithm is the representation of a leaf list by a collection of search trees, such that the leaf list of a node in the su#x tree of S can be constructed from the leaf lists of the children by e#cient merging. Hwang and Lin [13] described how to optimally merge two sorted lists of length n 1 and n 2 , where n 1 n 2 , with ) comparisons. Brown and Tarjan [7] described how to achieve the same number of comparisons for merging two AVL trees in time ) and Huddleston and Mehlhorn [12] showed a similar result for ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal of Computing, 1(1):31--39, 1972.
....document d and present it to the user. Figure 1: Evaluation of conjunctive Boolean queries exceptional case. More normally, and it is far more e#cient to perform a sequence of binary searches taking O( C log time, or even a sequence of fingered exponential and binary searches [19] taking time O( C log( I t C ) Each inverted list must still be read from disk, and so the overall time to process term t is O( I t C log( I t C ) O( I t )and the cost of processing the entire query is O( nevertheless, substantial CPU savings can be achieved. ....
F.K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal on Computing, 1(1):31--39, 1972.
....that we in constant time from the node e can find the nodes next(e) and prev (e) storing the next and previous element in increasing order. We use T to denote the size of T , i.e. the number of elements stored in T . E#cient merging of two AVL trees is essential to our methods. Hwang and Lin [70] show how to merge two sorted lists using the optimal number of comparisons. Brown and Tarjan [22] show how to implement merging of two height balanced search trees, e.g. AVL trees, in time proportional to the optimal number of comparisons. Their result is summarized in Lemma 4, which immediately ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal on Computing, 1(1):31--39, 1972.
....When merging two sorted lists that contain n 1 and n 2 elements, there are possible placements of the elements of one list in the combined list. For n 1 n 2 this gives that = #(n 1 log(n 2 n 1 ) comparisons are necessary to distinguish between the possible orderings. Hwang and Lin in [94] show how to merge two sorted lists that contain n 1 and n 2 elements using less than n 1 n 2 min n 1 , n 2 comparisons. Brown and Tarjan in [34] first note that it seems di#cult to implement the Hwang and Lin merging algorithm with a running time proportional to the number of ....
....in T in such a way that we in constant time from the node e can find the nodes next(e) and prev(e) storing the next and previous element. We use T to denote the size of T , i.e. the number of elements stored in T . E#cient merging of two AVL trees is essential to our methods. Hwang and Lin [94] show how to merge two sorted lists using the optimal number of comparisons. Brown and Tarjan [34] show how to implement merging of two height balanced search trees, e.g. AVL trees, in time proportional to the optimal number of comparisons. Their result is summarized in Lemma 7.2, which ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal on Computing, 1(1):31--39, 1972.
....the more uniform approach of dividing blocks always at half. In the merge part of our algorithm, the two blocks to be merged are not of the same size. Therefore, it is here better to use the binary merge routine, instead of the normal (unary 2 way) one. The binary merge algorithm was described in [8]. The basic idea is as follows. Let X and Y be the blocks to be merged. Let their sizes be m and n, respectively. For the sake of simplicity, assume that m n. Now let t = blog 2 (n=m)c and compare x 1 , the first element of X , to y 2 t , the 2 t th element of Y . If x 1 y 2 t , the proper ....
....moved to the output area followed by x 1 , and the merging process is repeated for X block h2; jXji and Y block hk; jY ji. If x 1 y 2 t , then Y block h1; 2 t i is moved to the output area and the merge process is repeated for X block h1; jXji and Y block h2 t 1; jY ji. Hwang and Lin [8] proved that the binary merge routine merges two blocks of size m and n with d log 2 Gamma m n m Delta e minfm;ng comparisons, which is O(m log 2 (n=m) The number of moves will be 2(m n) 1, if implemented as carefully as in the merges of the sort part. Now, in the merge part, the binary ....
Hwang F. K. and Lin S., A simple algorithm for merging two disjoint linearly ordered sets, SIAM J. Comput. 1 (1972) 31--39.
....in block W by jW j. For two adjacent blocks U and V , UV is the block consisting of all U elements followed by all V elements. If W = UV for blocks U , V , and W , then we write V = U Gamma1 W and U = WV Gamma1 . 2. 1 Comparisons in merging The binary merge routine of Hwang and Lin [5] was designed to save some comparisons in merging. We shall now describe how the comparisons are organized. Assume that two sorted sequences X and Y to be merged are of size m and n, respectively, with m n. The main idea is to granulate the Y sequence (implicitly) into blocks of size 2 t , ....
.... bn=2 t c. We have used t comparisons for each X element in the binary search. One more comparison was spent to compare x c with y 0 . The remaining comparisons (sequential search) are charged to Y elements transported to the output, one comparison per at least 2 t elements. Hwang and Lin [5] also proved that mt bn=2 t c is a lower bound for the number of comparisons performed by any merging algorithm, in place or not. The situation is not so simple for an in place algorithm, i.e. if the sorted output should be stored within the same array A[1 : m n] as subarrays containing the ....
Hwang F. K., Lin S., A simple algorithm for merging two disjoint linearly ordered sets, SIAM Journal on Computing 1 (1972), 31--39
.... is at position p and the other occurrence is at a position q in the interval R(p; j j) respectively L(p; j j) of positions. element. We use jT j to denote the size of T , i.e. the number of elements stored in T . Efficient merging of two AVL trees is essential to our methods. Hwang and Lin [14] show how to merge two sorted lists using the optimal number of comparisons. Brown and Tarjan [4] show how to implement merging of two height balanced search trees, e.g. AVL trees, in time proportional to the optimal number of comparisons. Their result is summarized in Lemma 3.1, which immediately ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal on Computing, 1(1):31--39, 1972. Finding Maximal Pairs with Bounded Gap 27
....way that we in constant time from the node e can nd the nodes next(e) and prev(e) storing the next and previous element in increasing order. We use jT j to denote the size of T , i.e. the number of elements stored in T . Ecient merging of two AVL trees is essential to our methods. Hwang and Lin [13] show how to merge two sorted lists using the optimal number of comparisons. Brown and Tarjan [3] show how to implement merging of two height balanced search trees, e.g. AVL trees, in time proportional to the optimal number of comparisons. Their result is summarized in Lemma 2, which immediately ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal on Computing, 1(1):31-39, 1972.
....understanding of the latter algorithm. Currently, no significant facts are known about the expected behavior of binary merge over data drawn from any standard probability distribution. Keywords: Analysis of algorithms, merging 1 Introduction The binary merging algorithm due to Hwang and Lin [3], together with subsequent improvements (see, for example, 1, 6, 7] is the best general purpose merging algorithm known to date. Binary merge consists of two components: a first component in which an array index is incremented by a number nearly equal to the ratio of the sizes of the two arrays ....
....to be about right ) followed by even linear search does not give more than a constant factor gain. Binary search seems to be the only winning factor in binary merge and even the worst case guarantee of binary merge, which is dlg Gamma m n m Delta e min(m; n) for arrays of size m and n [3], looks relatively satisfactory. We hope that, using techniques similar to those described here, a precise expected case analysis of binary search itself may be obtained (something that is currently not known) Another interesting question is whether there is some naturally occuring distribution ....
F.K. Hwang and S. Lin, A simple algorithm for merging two disjoint linearly ordered sets, SIAM J. Comp. 1 (1972) 31-39.
....that we in constant time from the node e can nd the nodes next(e) and prev (e) storing the next and previous element in increasing order. We use jT j to denote the size of T , i.e. the number of elements stored in T . E cient merging of two AVL trees is essential to our methods. Hwang and Lin [12] show how to merge two sorted lists using the optimal number of com parisons. Brown and Tarjan [4] show how to implement merging of two heightbalanced search trees, e.g. AVL trees, in time proportional to the optimal number of comparisons. Their result is summarized in Lemma 4, which ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal on Computing, 1(1):31-39, 1972.
....of n elements or two total orders. The Ford Johnson sorting algorithm ( 11] and its improvements due to Manacher ( 26, 27, 28] and Bui and Thanh ( 7, 40] yield tight upper bounds on the difficulty of sorting. The merging problem has received a similar amount of attention (see for example, [9, 13, 15, 16, 17, 23, 27, 31, 30, 39]) Much effort has also been expended on finding optimal algorithms to select the i th largest of n elements ( 2, 4, 19, 22, 32, 35] to construct heaps ( 8, 12] to construct priority queues ( 6, 41] to search in a partial or total order ( 5, 22, 18, 24, 25] and so on. However, except for ....
.... ) n Gamma i (i Gamma 1)dlg(n Gamma i 2)e [14] C(U n ; U (n Gamma1) 2 Theta U 1 Theta U (n Gamma1) 2 ) 3n o(n) 35] C(U n ; R n ) ndlg(3n=4)e Gamma b2 blg 6nc =3c b 1 2 lg 6nc [11] C(Rm R n Gammam ; R n ) m(1 blg kc) bmk=2 blg kc c Gamma 1; 8n 2m; k = n Gammam m [17] Recursions: C(U n ; U i Theta U n Gammai ) C(U n ; U i Gamma1 Theta U 1 Theta U n Gammai ) C(U n ; U i Gamma1 Theta U 1 Theta U n Gammai ) C(U n ; R i Theta U n Gammai ) C(Rm R n Gammam ; R n ) C(Rm 1 R n Gammam ; R n ) C(Rm k R n Gammam Gammak ; R n ) C(Rm R n Gammam Gammak ; ....
Hwang, F. K. and Lin, S.; "A Simple Algorithm for Merging Two Disjoint Linearly-Ordered Sets," SIAM Journal of Computing, 1, 31-39, 1972.
....and element assignments. SPLITMERGE [1] matches the lower bounds but uses O(m) extra space. The algorithm of Mannila and Ukkonen matches all the lower bounds (number of comparisons assignments and extra space) but is unstable. To achieve that, it uses the binary merging algorithm of Hwang and Lin [12]. This paper serves two purposes. Firstly it presents a collection of useful techniques used in merging and, secondly, it presents an optimal stable in place merging algorithm. We show how to make stable the algorithm of Mannila and Ukkonen while maintaining the same asymptotic complexity on the ....
....its modification to allow non consecutive blocks that can start at any location of the array) The only advantage is the simpler control structure. 2. 2 Binary Like Searching We present the technique (which we call binary like searching) that Hwang and Lin used in their binarymerging algorithm [12][13, pages 204 206] It is through the binary like searching technique that we succeed in reducing the number of comparisons of the merging algorithm from O(N) to O(m log( n m 1) We are given a sorted sequence of N elements and element x to be inserted in that sequence. Binarylike searching ....
F.K.Hwang and S. Lin, "A Simple Algorithm for Merging Two Disjoint Linearly Ordered Sets", SIAM Journal on Computing 1 (1972), 31-39.
....e comparisons in the worse case since an algorithm needs to distinguish between the Gamma n m n Delta possible placements of the n keys of N in the result. Without loss of generality we will henceforth assume m n, in which case dlg Gamma n m n Delta e = m lg(n=m) Hwang and Lin [14, 18] described an algorithm that matches this lower bound, but the algorithm assumes the input sets are in arrays and only returns cross pointers between the arrays. To rearrange the data into a single ordered output array requires an additional O(n m) steps. Brown and Tarjan gave the first (m ....
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal of Computing, 1:31--39, Mar. 1972.
....assignments. SPLITMERGE [1] matches the lower bounds but uses O(m) extra space. The algorithm of Mannila and 127 Ukkonen matches all the lower bounds (number of comparisons assignments and extra space) but is unstable. To achieve that, it uses the binary merging algorithm of Hwang and Lin [11]. In this paper, we show how to make stable the algorithm of Mannila and Ukkonen while maintaining the same asymptotic complexity on the number of comparisons, assignments and the extra space. This yields the first optimal stable merging algorithm with respect to all known lower bounds. ....
....gcd( denotes the greatest common divisor function. Furthermore, locations 0 : gcd(m; s Gamma m) Gamma 1 belong to different cycles. 129 2. 2 Binary like searching We present the technique (which we call binary like searching) that Hwang and Lin used in their binary merging algorithm [11][12, pages 204 206] It is through the binary like searching technique that we succeed in reducing the number of comparisons of the merging algorithm from O(N) to O(m log(n=m) We are given a sorted sequence of N elements and element x to be inserted in that sequence. Binary like searching finds ....
F.K.Hwang and S. Lin, "A Simple Algorithm for Merging Two Disjoint Linearly Ordered Sets", SIAM Journal on Computing 1 (1972), 31-39.
....the best merging algorithm. As usual, we can speak of worst case and average case complexity. The worst case complexity of the merging problem is quite well studied. The most widely used merging algorithm which performs well for any values of m and n is binary merge was invented by Hwang and Lin [5]. They have shown that the complexity of binary merge in the worst case is at most L(n; m) n; where L(n; m) log 2 Gamma n m n Delta is the obvious lower bound coming from information theory. Several much more complicated merging algorithms were proposed later by Christen [1] and Manacher ....
....Accordingly, we shall analyse a simpler algorithm (with the specification that all the insertions are insertions of elements of B into A) which we call algorithm HL; and check our assertion about the sizes of the unmerged parts of the lists. We refer the reader to the paper of Hwang and Lin ([5]) for the description of their algorithm. For convenience, we shall express the algorithm HL in terms of the J(i) s as follows. Algorithm HL J(0) 0 for i = 1 to n do r : blog 2 i m GammaJ(i Gamma1) n Gammai 1 j c s : 2 r l : b m GammaJ(i Gamma1) s c for k = 1 to l do j : J(i ....
F. K. Hwang and S. Lin (1972), A simple algorithm for merging two disjoint linearly ordered lists, SIAM J. COMPUT. 1, pp. 31-39.
No context found.
F. K. Hwang and S. Lin. A simple algorithm for merging two disjoint linearly ordered sets. SIAM Journal of Computing, 1(1):31--39, 1972.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC