The role of dynamic programming & control structures in performance

  • Authors:
  • Robert Bernecky

  • Affiliations:
  • Snake Island Research Inc., 18 Fifth St., Ward's Island, Toronto, Canada M5J 2B9

  • Venue:
  • APL '95 Proceedings of the international conference on Applied programming languages
  • Year:
  • 1995

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic programming is used infrequently by APL programmers, in spite of its ability to reduce the computational effort required to solve many problems. This paper uses the String Shuffle problem as the basis for a comparison of brute force, recursive, and dynamic programming algorithms. Simple algorithms for each of these approaches are designed and evaluated, then individually optimized and re-evaluated, to show the benefits of dynamic programming.The dynamic programming algorithm is then recast to use flow control structures recently introduced into ISI J and APL*PLUS III. Use of control structures in conjunction with dynamic programming results in orders of magnitude performance improvement over brute force and naive recursive algorithms. APL*PLUS III control structures are shown to provide a performance improvement of up to 30% over GOTO-based loops.