## Abstract

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 case O(n log n) 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.

Original language | English |
---|---|

Pages (from-to) | 1-15 |

Number of pages | 15 |

Journal | Acta Informatica |

Volume | 18 |

Issue number | 1 |

DOIs | |

State | Published - Mar 1982 |

Externally published | Yes |