Abstract
Anorder-statistic deque is a deque that also supports the operationfind(k, D), wherefind(k, D) returns the item inD with rankk. Assumingk is fixed, we show how to implement an order-statistic deque so thatinject(x, D), eject(D), push(x, D), andpop(D) take O(logk) amortized time andfind(k, D) takes worst-case constant time; the time bounds can be made worst case using a technique of Gajewska and Tarjan. We also show our implementations are optimal in the algebraic decision tree model of computation. This deque is applied to three problems: computing order-statistic filters, finding a smallest area convex quadrilateral in the plane, and computing “batched” order statistics.
Similar content being viewed by others
References
Atkinson, M.D., Sack, J., Santoro, N., Strothotte, T.: Min-max heaps and generalized priority queues. Commun. ACM29(10), 996–1000 (1986)
Beardwood, J., Halton, J.H., Hammersley, J.M.: The shortest path through many points. Proc. Cambridge Philos. Soc.55, 299–327 (1959)
Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to algorithms. London: McGraw-Hill 1990
Dobkin, D.P., Munro, J.I.: Efficient uses of the past. J. Algorithms6, 455–465 (1985)
Edelsbrunner, H.: Algorithms in combinatorial geometry. Berlin Heidelberg New York: Springer 1987
Eppstein, D.: New algorithms for minimum areak-gons. Proc. Third Annual ACM-SIAM Symposium on Discrete Algorithms, 1992, pp. 83–88
Eppstein, D., Overmars, M., Rote, G., Woeginger, G.: Finding minimum areak-gons. Discrete Comput. Geom.7, 45–58 (1992)
Few, L.: The shortest path and the shortest road throughn points. Mathematika2, 141–144 (1955)
Frederickson, G.N., Johnson, D.B.: Generalized selection and ranking: sorted matrices. SIAM J. Comput.13(1), 14–30 (1984)
Fredman, M.L., Spencer, T.H.: Refined complexity analysis for heap operations. J. Comput. Syst. Sci.35, 269–284 (1987)
Gajewska, H., Tarjan, R.E.: Deques with heap order. Inf. Process. Lett.22, 197–220 (1986)
Guibas, L., Stolfi, J.: On computing all north-east neighbors in theL 1 metric. Inf. Process. Lett.17, 219–223 (1983)
Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput.13(2), 329–337 (1984)
Hwang, F.K.: An O(n logn) algorithm for rectilinear minimal spanning trees. J. ACM26(2), 177–182 (1979)
Maragos, P., Schafer, R.W.: Morphological filters — Part II: their relation to median, orderstatistic and stack filters. IEEE Trans. Acoust. Speech Signal Process.ASSP-35, 1170–1184 (1987)
Papadimitriou, C.H., Steiglitz, K.: Combinatorial Optimization. Englewood Cliffs: Prentice-Hall 1982
Richards, D.S.: VLSI median filters.IEEE Trans. Acoust. Speech Signal Process.ASSP-38, 145–153 (1990)
Shamos, M. I.: Geometry and statistics: problems at the interface. In: Algorithms and complexity: new directions and recent results, pp. 251–280. New York: Academic Press 1976
Vuillemin, J.: A unifying look at data structures. Commun. ACM23(4), 229–239 (1980)
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Richards, D.S., Salowe, J.S. Stacks, queues, and deques with order-statistic operations. Acta Informatica 29, 395–414 (1992). https://doi.org/10.1007/BF01193574
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF01193574