Skip to main content
Log in

Stacks, queues, and deques with order-statistic operations

  • Published:
Acta Informatica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Atkinson, M.D., Sack, J., Santoro, N., Strothotte, T.: Min-max heaps and generalized priority queues. Commun. ACM29(10), 996–1000 (1986)

    Google Scholar 

  2. Beardwood, J., Halton, J.H., Hammersley, J.M.: The shortest path through many points. Proc. Cambridge Philos. Soc.55, 299–327 (1959)

    Google Scholar 

  3. Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to algorithms. London: McGraw-Hill 1990

    Google Scholar 

  4. Dobkin, D.P., Munro, J.I.: Efficient uses of the past. J. Algorithms6, 455–465 (1985)

    Google Scholar 

  5. Edelsbrunner, H.: Algorithms in combinatorial geometry. Berlin Heidelberg New York: Springer 1987

    Google Scholar 

  6. Eppstein, D.: New algorithms for minimum areak-gons. Proc. Third Annual ACM-SIAM Symposium on Discrete Algorithms, 1992, pp. 83–88

  7. Eppstein, D., Overmars, M., Rote, G., Woeginger, G.: Finding minimum areak-gons. Discrete Comput. Geom.7, 45–58 (1992)

    Google Scholar 

  8. Few, L.: The shortest path and the shortest road throughn points. Mathematika2, 141–144 (1955)

    Google Scholar 

  9. Frederickson, G.N., Johnson, D.B.: Generalized selection and ranking: sorted matrices. SIAM J. Comput.13(1), 14–30 (1984)

    Google Scholar 

  10. Fredman, M.L., Spencer, T.H.: Refined complexity analysis for heap operations. J. Comput. Syst. Sci.35, 269–284 (1987)

    Google Scholar 

  11. Gajewska, H., Tarjan, R.E.: Deques with heap order. Inf. Process. Lett.22, 197–220 (1986)

    Google Scholar 

  12. Guibas, L., Stolfi, J.: On computing all north-east neighbors in theL 1 metric. Inf. Process. Lett.17, 219–223 (1983)

    Google Scholar 

  13. Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput.13(2), 329–337 (1984)

    Google Scholar 

  14. Hwang, F.K.: An O(n logn) algorithm for rectilinear minimal spanning trees. J. ACM26(2), 177–182 (1979)

    Google Scholar 

  15. 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)

    Google Scholar 

  16. Papadimitriou, C.H., Steiglitz, K.: Combinatorial Optimization. Englewood Cliffs: Prentice-Hall 1982

    Google Scholar 

  17. Richards, D.S.: VLSI median filters.IEEE Trans. Acoust. Speech Signal Process.ASSP-38, 145–153 (1990)

    Google Scholar 

  18. 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

    Google Scholar 

  19. Vuillemin, J.: A unifying look at data structures. Commun. ACM23(4), 229–239 (1980)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01193574

Keywords

Navigation