Information Processing EISEVIER Information Processing Letters 53 (1995) 37-47 Letters An efficient selection algorithm on the pyramid C.C. Aggarwal, N. Jain, P. Gupta * Department of Computer Science and Engineering, Indian Institute of Technology, Kanpur 208 016, India Communicated by S.G. Aid; received 4 May 1993; revised 9 August 1994 zyxwvutsrqponmlkjihgfedcbaZYX Abstract This paper presents a generalized selection algorithm on a two-dimensional pyramid model. The algorithm finds the weighted quantile of order f out of N elements x1, x2,. . . , xN where a non-negative weight wi is assigned to each element xi for all i so that CK1wi = zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDC W. The algorithm has a time complexity of O(@JFV)E) using N processors for some E lying between 0 and 1. When w1 = w2 = *. . = w,.., = 1, the problem reduces to that of finding the kth largest element out of N elements. In that case the algorithm has a time complexity of O(N’) and a cost of O(N' +&), for some E lying between 0 and 1. Keywords: Pyramid mode; kth element; Parallel algorithms 1. Introduction This paper deals with the problem of selection on a two-dimensional pyramid model. The problem which we want to discuss in this paper is a generalized version of the problem of finding the k th largest element out of N elements. Our aim is to find the element of weighted quantile of order f out of N elements, where a non-negative weight is assigned to each element in the set. Let x1, x2,. . . , xN be a set of N elements and wi be the weight assigned to xi so that w1 + w2 + . . . + whi= W is the total weight. If (Y,? Y2,...1 yN) is the sorted sequence of (x,, x2,. . . , xN), then yi is defined to be the weighted quantile of order f where i satisfies the following: zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGF i-l &.ij<f*Wg hUj zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA j=l j=l where uj is the weight assigned to yj. Note that a special case of this problem would be when w1=w2= ** * w, = 1 and f = k/N, in which case the problem reduces to that of finding the k th largest element out of N elements. There exist parallel algorithms for finding the kth largest element from N elements x1, x2,. . . , xN on Shared Memory Model [2], Mesh-Connected Computers [6,91, Hypercube and Perfect Shuffle Computer l Corresponding author. 0020-1090/95/$09.50 0 1995 Elsevier Science B.V. All rights reserved SSDIOO20-0190(94)00160-X