Skip to main content
Log in

Some modified algorithms for Dijkstra's longest upsequence problem

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

Using the techniques of “specification and transformation by parts”, algorithms are derived for the longest upsequence problem. First Dijkstra's algorithm and then two new modified merge algorithms are derived and presented in detail. The merge algorithms take advantage of natural runs in the input sequence and have a worst caseO(n logn) time complexity when appropriate merging techniques are used, but can be linear if long runs are present in the sequence. The first merge algorithm is logically equivalent to Dijkstra's algorithm; the second algorithm is based on the first one but uses a different merging technique. Expository remarks describe related results which evolved out of our work in programming by transformation; in particular, parallels are drawn between algorithms for the longest upsequence problem and algorithms for sorting.

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. Dijkstra, E.W.: Some beautiful arguments using mathematical induction. Acta Informat.13, 1–8 (1980)

    Google Scholar 

  2. Dewar, R.B.K., Merritt, S.M.: A derivation of sorting algorithms (to be published)

  3. Dewar, R.B.K., Schonberg, E.: The elements ofSETL style. Proc. ACM Conf., Detroit 1979

  4. Dewar, R.B.K., Schonberg, E., Schwartz, J.T.: Higher level programming. CIMS, New York University 1981

  5. Green, C., Barstow, D.R.: On program synthesis knowledge. Artifical Intelligence10, 241–279 (1978

    Google Scholar 

  6. Hwang, F.K., Lin, S.: A simple algorithm for merging two disjoint linearly ordered sets. SIAM J. Computing1, 31–39 1972

    Google Scholar 

  7. Knuth, D.E.: The art of computer programming, Vol. III: Sorting and searching. Addison-Wesley, Reading, MA, USA, 1973

    Google Scholar 

  8. Manacher, G.K.: Significant improvements to the Hwang-Lin merging algorithm. JACM26, 3, 434–440 (1979)

    Google Scholar 

  9. Manacher, G.K.: The Ford Johnson Sorting Algorithm is not optimal. JACM26, 3, 441–456 (1979)

    Google Scholar 

  10. Merritt, S.M.: The role of the high level specification in programming by transformation: Specification and transformation by parts. Ph.D. Thesis, Computer Science Dept. New York University, 1982

  11. Schwartz, J.T.: On programming: An interim report on theSETL project. CIMS, New York University, 1974

  12. Sharir, M.: Some observations concerning formal differentiation of set-theoretic expressions. ACM TOPLAS4, 2, 196–225 (1982)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Work on this paper has been supported in part by: ONR Grant N00014-75-C-0571; NSF Grant MCS-80-04349; USDOE Contract EY-76-C-02-3077

Rights and permissions

Reprints and permissions

About this article

Cite this article

Dewar, R.B.K., Merritt, S.M. & Sharir, M. Some modified algorithms for Dijkstra's longest upsequence problem. Acta Informatica 18, 1–15 (1982). https://doi.org/10.1007/BF00625277

Download citation

  • Received:

  • Issue Date:

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

Keywords

Navigation